From owner-freebsd-current@FreeBSD.ORG Mon Apr 23 19:39:35 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 C317916A401 for ; Mon, 23 Apr 2007 19:39:35 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (c220-239-3-125.belrs4.nsw.optusnet.com.au [220.239.3.125]) by mx1.freebsd.org (Postfix) with ESMTP id 3563913C448 for ; Mon, 23 Apr 2007 19:39:34 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by turion.vk2pj.dyndns.org (8.13.8/8.13.8) with ESMTP id l3NJdXIf003026; Tue, 24 Apr 2007 05:39:33 +1000 (EST) (envelope-from peter@turion.vk2pj.dyndns.org) Received: (from peter@localhost) by turion.vk2pj.dyndns.org (8.13.8/8.13.8/Submit) id l3NJdXcS003025; Tue, 24 Apr 2007 05:39:33 +1000 (EST) (envelope-from peter) Date: Tue, 24 Apr 2007 05:39:33 +1000 From: Peter Jeremy To: Howard Su Message-ID: <20070423193932.GA842@turion.vk2pj.dyndns.org> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="y0ulUmNC+osPPQO6" Content-Disposition: inline In-Reply-To: X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.14 (2007-02-12) Cc: current@freebsd.org, jbr@humppa.dk 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: Mon, 23 Apr 2007 19:39:35 -0000 --y0ulUmNC+osPPQO6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2007-Apr-22 16:39:58 -0700, Howard Su wrote: >1. System wide global readonly page which will help on these syscalls: > gethostname,getdomainname,uname > help on importing sysenter as syscall entry point!! > >2. Per process Readonly page. (change will still through standard syscall) > help on the syscalls: > getuid, geteuid, getpid,getgid, getegid, getpgrp, I do not believe that these syscalls are called frequently enough that improving their efficiency will be measurable anywhere other than microbenchmarks that specifically measure their speed. I had a quick look through syscall.h and didn't see any syscalls that were both used often and were amenable to this approach. Before spending much efford on implementing this shared-page approach, I would suggest that you instrument syscall() to count the number of syscalls by type see if any heavily used syscalls can be implemented using this approach. The comment was made elsewhere "if it's easy to do, do it anyway, even if there's no measurable benefit". I would strongly disagree with this comment. Any code that is added to FreeBSD requires ongoing effort to maintain it - even if it's just waiting longer for the system to compile. Special casing some system calls means that those system calls need special regression tests to ensure that they haven't been broken somehow. Unless there is some benefit, then don't bother making the change. FreeBSD does appear to have higher syscall overheads than (eg) Linux. The best solution is to work on reducing this overhead in general (trap handling and syscall(), rather than identifying a small subset of syscalls and bypassing the syscall overhead for them. --=20 Peter Jeremy --y0ulUmNC+osPPQO6 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFGLQt0/opHv/APuIcRAokOAJ45Uptsk3dqRhHIdUwpD4sllzQl/QCeLRi3 VZzZVHPdlpjE1zGpDpIj33Y= =ehjZ -----END PGP SIGNATURE----- --y0ulUmNC+osPPQO6--