From owner-freebsd-hackers Mon May 4 00:58:30 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id AAA10901 for freebsd-hackers-outgoing; Mon, 4 May 1998 00:58:30 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from nighthawk.iti.gov.sg (nighthawk.iti.gov.sg [192.122.131.51]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id AAA10892 for ; Mon, 4 May 1998 00:58:22 -0700 (PDT) (envelope-from joerg@krdl.org.sg) Received: (from mailer@localhost) by nighthawk.iti.gov.sg (8.6.11/8.6.11) id QAA02877; Mon, 4 May 1998 16:08:07 +0800 Received: from mailhub.iti.gov.sg(192.122.132.132) by nighthawk.iti.gov.sg via smap (V1.3) id sma002872; Mon May 4 16:07:42 1998 Received: (from joerg@localhost) by iti.gov.sg (8.8.8/8.8.5) id PAA27007; Mon, 4 May 1998 15:51:23 +0800 (SGT) Message-ID: <19980504155123.20764@krdl.org.sg> Date: Mon, 4 May 1998 15:51:23 +0800 From: Joerg Micheel To: Greg Lehey Cc: John-Mark Gurney , FreeBSD Hackers Subject: Re: Context switch time References: <19980425034313.55993@hydrogen.nike.efn.org> <19980504143736.L4777@freebie.lemis.com> <19980503222303.36966@hydrogen.nike.efn.org> <19980504140442.52763@krdl.org.sg> <19980504155242.P4777@freebie.lemis.com> <19980504152056.47011@krdl.org.sg> <19980504171054.X4777@freebie.lemis.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.88e In-Reply-To: <19980504171054.X4777@freebie.lemis.com>; from Greg Lehey on Mon, May 04, 1998 at 05:10:54PM +0930 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, May 04, 1998 at 05:10:54PM +0930, Greg Lehey wrote: > On Mon, 4 May 1998 at 15:20:56 +0800, Joerg Micheel wrote: > > Hmm, interesting, it's called getpid.c, but it calls getuid :-) Ha! That's the bottleneck! :-)))). Ok. Just for completeness sake: The initial test program obviously was: # include void main() { for(;;) (void)getpid(); } which has been converted to: # include # include # include void main() { int loop = 1000000; long long total; /* in usecs */ while(loop--) { gettimeofday(&start, NULL); while(loop--) (void)getpid(); gettimeofday(&stop, NULL); } total = ((long long)stop.tv_sec * 1000000 + (long long)stop.tv_usec) - ((long long)start.tv_sec * 1000000 + (long long)start.tv_usec); printf("%qd\n", total); } I just put another loop around it and computed the calls/sec in the latest version. > Hmmm. This suggests to me that we're hitting some other limit. Joerg -- Joerg B. Micheel Email: SingAREN Technology Center Phone: +65 7705577 Kent Ridge Digital Labs Fax: +65 7795966 11 Science Park Road Pager: +65 96016020 Singapore Science Park II Plan: Troubleshooting ATM 117685 Singapore Networks and Applications To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message