Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 May 1998 22:23:03 -0700
From:      John-Mark Gurney <gurney_j@efn.org>
To:        Greg Lehey <grog@lemis.com>
Cc:        Robert Watson <robert@cyrus.watson.org>, freebsd-hackers@FreeBSD.ORG
Subject:   Re: Context switch time
Message-ID:  <19980503222303.36966@hydrogen.nike.efn.org>
In-Reply-To: <19980504143736.L4777@freebie.lemis.com>; from Greg Lehey on Mon, May 04, 1998 at 02:37:36PM %2B0930
References:  <Pine.BSF.3.96.980425041329.28708A-100000@fledge.watson.org> <19980425034313.55993@hydrogen.nike.efn.org> <19980504143736.L4777@freebie.lemis.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980503222303.36966>