From owner-freebsd-hackers Sun May 3 22:23:26 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id WAA23134 for freebsd-hackers-outgoing; Sun, 3 May 1998 22:23:26 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from d183-205.uoregon.edu (d183-205.uoregon.edu [128.223.183.205]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id WAA23129 for ; Sun, 3 May 1998 22:23:21 -0700 (PDT) (envelope-from gurney_j@efn.org) Received: (from jmg@localhost) by d183-205.uoregon.edu (8.8.7/8.8.7) id WAA09422; Sun, 3 May 1998 22:23:03 -0700 (PDT) Message-ID: <19980503222303.36966@hydrogen.nike.efn.org> Date: Sun, 3 May 1998 22:23:03 -0700 From: John-Mark Gurney To: Greg Lehey Cc: Robert Watson , freebsd-hackers@FreeBSD.ORG Subject: Re: Context switch time References: <19980425034313.55993@hydrogen.nike.efn.org> <19980504143736.L4777@freebie.lemis.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.69 In-Reply-To: <19980504143736.L4777@freebie.lemis.com>; from Greg Lehey on Mon, May 04, 1998 at 02:37:36PM +0930 Reply-To: John-Mark Gurney Organization: Cu Networking X-Operating-System: FreeBSD 2.2.1-RELEASE i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Greg Lehey scribbled this message on May 4: > On Sat, 25 April 1998 at 3:43:13 -0700, John-Mark Gurney wrote: > > Robert Watson scribbled this message on Apr 25: > >> I was wondering what the average context switch time across a syscall > >> invocation is, also, how long it takes to switch in a different process. > >> Presumably just on a Pentium 100ish processor. Is this data I can > >> retrieve from the kernel profiler? mi_switch and tsleep both appear in > >> the profiling data, but it is not clear to me that this includes the time > >> for the switch to kernel context, etc. > > > > one thing you might try is to run something like a process that just > > does a yield syscall (-current box) repeatedly... I was getting about > > 111k syscalls/sec from a program on my k6/225... (systat couldn't display > > numbers greater than 5 sig figs, so I had to use vmstat :) ) > > Strange. This is what I get from a program that repeatedly calls > getpid() on my K6/233: > > procs memory page faults cpu > r b w avm fre flt re pi po fr sr w0 in sy cs us sy id [...] did this on my machine (k6/225 w/ 75mhz bus) and I got similar numbers.. I was consitantly getting 700k+ syscalls... > As you can see from the second-to-last line (where I started this > message), the system is doing other things too, so I suspect the > correct idle value would be round 730,000 syscalls per second. This > suggests that yield() is doing quite a bit of processing itself. not sure why it would be that expensive.. I didn't look at the function to re-add the process to the run queue, but considering that it only takes ~7 times as long to return a value than to actually do some data manipulation, that isn't to bad... -- John-Mark Gurney Modem Rev/FAX: +1 541 346 9237 Cu Networking P.O. Box 5693, 97405 Live in Peace, destroy Micro$oft, support free software, run FreeBSD Don't trust anyone you don't have the source for To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message