From owner-freebsd-current@FreeBSD.ORG Tue Apr 24 04:05:52 2007 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C8B4E16A401 for ; Tue, 24 Apr 2007 04:05:52 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from kientzle.com (h-66-166-149-50.snvacaid.covad.net [66.166.149.50]) by mx1.freebsd.org (Postfix) with ESMTP id A133F13C448 for ; Tue, 24 Apr 2007 04:05:52 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from [10.0.0.222] (p54.kientzle.com [66.166.149.54]) by kientzle.com (8.12.9/8.12.9) with ESMTP id l3O45pH7081006; Mon, 23 Apr 2007 21:05:51 -0700 (PDT) (envelope-from kientzle@freebsd.org) Message-ID: <462D821F.6030707@freebsd.org> Date: Mon, 23 Apr 2007 21:05:51 -0700 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.12) Gecko/20060422 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Maxime Henrion References: <20070423113400.GC28587@gw.humppa.dk> <462CD251.9060105@freebsd.org> <20070423161711.GV39474@elvis.mu.org> In-Reply-To: <20070423161711.GV39474@elvis.mu.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: current@freebsd.org, "Jesper B. Rosenkilde" Subject: Re: Suggestions on Avoiding syscall Overhead X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2007 04:05:52 -0000 >>>>We can have 3 type of pages mapped into one process's address map. >>>>1. System wide global readonly page which will help on these syscalls: >>>> gethostname,getdomainname,uname >>>>2. Per process Readonly page. (change will still through standard syscall) >>>> help on the syscalls: >>>> getuid, geteuid, getpid,getgid, getegid, getpgrp, >> >>I don't really understand this suggestion. >>Do any real programs call these syscalls very often? > > There is indeed more and more programs calling some syscalls a > *lot* .... MySQL calls gettimeofday() so much that changing > the timer used on a system can lead to a very observable performance > improvement. Similarly, PostgreSQL calls setproctitle() a lot ... Accelerating gettimeofday() makes a lot of sense; I've seen a lot of programs that call it very often. I'm not convinced about calls such as getuid() and gethostname(), though. Putting this kind of information in userspace introduces forward-compatibility concerns. People do statically link against libc, so you have to make sure that libc can find this information even when running on future kernels. That makes each such call a tricky maintenance issue. Tim