From owner-freebsd-current@FreeBSD.ORG Tue Apr 24 04:53:56 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 A9DCD16A400; Tue, 24 Apr 2007 04:53:56 +0000 (UTC) (envelope-from kris@obsecurity.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 95F8513C455; Tue, 24 Apr 2007 04:53:56 +0000 (UTC) (envelope-from kris@obsecurity.org) Received: from obsecurity.dyndns.org (elvis.mu.org [192.203.228.196]) by elvis.mu.org (Postfix) with ESMTP id 836831A4DC2; Mon, 23 Apr 2007 21:54:19 -0700 (PDT) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id E3DB55138E; Tue, 24 Apr 2007 00:53:55 -0400 (EDT) Date: Tue, 24 Apr 2007 00:53:55 -0400 From: Kris Kennaway To: Tim Kientzle Message-ID: <20070424045355.GA6330@xor.obsecurity.org> References: <20070423113400.GC28587@gw.humppa.dk> <462CD251.9060105@freebsd.org> <20070423161711.GV39474@elvis.mu.org> <462D821F.6030707@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <462D821F.6030707@freebsd.org> User-Agent: Mutt/1.4.2.2i 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:53:56 -0000 On Mon, Apr 23, 2007 at 09:05:51PM -0700, Tim Kientzle wrote: > >>>>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. Well you will have to keep compatibility syscalls anyway, because not everything even links to libc ;) Kris