From owner-freebsd-hackers Sun May 3 22:08:07 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id WAA20374 for freebsd-hackers-outgoing; Sun, 3 May 1998 22:08:07 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from freebie.lemis.com (freebie.lemis.com [139.130.136.133]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id WAA20236 for ; Sun, 3 May 1998 22:07:56 -0700 (PDT) (envelope-from grog@lemis.com) Received: (from grog@localhost) by freebie.lemis.com (8.8.8/8.8.7) id OAA06037; Mon, 4 May 1998 14:37:37 +0930 (CST) (envelope-from grog) Message-ID: <19980504143736.L4777@freebie.lemis.com> Date: Mon, 4 May 1998 14:37:36 +0930 From: Greg Lehey To: John-Mark Gurney , Robert Watson Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Context switch time References: <19980425034313.55993@hydrogen.nike.efn.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.91.1i In-Reply-To: <19980425034313.55993@hydrogen.nike.efn.org>; from John-Mark Gurney on Sat, Apr 25, 1998 at 03:43:13AM -0700 WWW-Home-Page: http://www.lemis.com/~grog Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 2 0 0 3770984 4632 7 0 0 0 8 34 1 302 429 73 4 2 94 1 0 0 3770992 4372 56 1 2 0 11 0 0 307 719494 35 34 66 0 1 0 0 3771688 4220 134 4 3 12 22 2372 6 375 687120 67 34 66 0 1 0 0 3769920 4784 132 16 0 13 119 4308 12 500 659404 93 33 67 0 1 0 0 3762592 4944 103 8 0 0 118 0 4 466 684348 71 40 60 0 1 0 0 3761616 5520 97 0 0 0 156 0 0 324 694288 66 40 60 0 1 0 0 3761616 5520 1 0 0 0 0 0 0 235 712159 24 36 64 0 1 0 0 3761616 5520 1 0 0 0 0 0 0 235 730958 26 31 69 0 1 0 0 3750512 5780 9 0 0 0 36 0 0 256 729640 27 39 61 0 1 0 0 3749768 6024 9 2 0 0 36 0 0 266 729086 28 38 62 0 2 0 0 3746464 6304 9 0 0 0 38 0 0 256 727910 24 33 67 0 1 0 0 3746464 6304 1 0 0 0 0 0 3 236 729221 25 34 66 0 1 0 0 3746464 6304 1 0 0 0 0 0 0 232 731855 25 36 64 0 1 0 0 3746740 6304 1 0 0 0 0 0 0 233 731497 27 34 66 0 1 0 0 3748076 6304 1 0 0 0 0 0 0 264 723896 82 36 64 0 1 0 0 3748648 6300 2 0 0 0 0 0 0 267 725709 75 37 63 0 1 0 0 3757944 4352 320 42 14 8 14 2210 17 256 434830 241 48 52 0 1 0 0 3759064 4352 1 0 0 0 0 0 0 279 706062 208 36 64 0 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. Greg -- See complete headers for address and phone numbers finger grog@lemis.com for PGP public key To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message