Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Apr 1998 03:43:13 -0700
From:      John-Mark Gurney <gurney_j@efn.org>
To:        Robert Watson <robert@cyrus.watson.org>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Context switch time
Message-ID:  <19980425034313.55993@hydrogen.nike.efn.org>
In-Reply-To: <Pine.BSF.3.96.980425041329.28708A-100000@fledge.watson.org>; from Robert Watson on Sat, Apr 25, 1998 at 04:17:45AM -0400
References:  <Pine.BSF.3.96.980425041329.28708A-100000@fledge.watson.org>

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

as far as context switching goes... that is a difficult subject... Stanford
did a paper comparing a few os's on context switch time and found that
Linux was able to get about 10ms switch time, but this assumed that you
had only a couple active processes... as soon as you went above 10 active
processes the context switch time grew to be >100ms, while FreeBSD pretty
much maintained a steady 100ms switch time for even 1k processes, while
linux grew to >700ms...  (these numbers are from the top of my head)

it looks like the paper can still be found at
http://mosquitonet.stanford.edu/~laik/benchmarks/paper/talk.ps
for the actual graphs...  these tests were done on P133 machines IIRC...

-- 
  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?19980425034313.55993>