From owner-freebsd-hackers Sat Apr 25 03:43:20 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id DAA10082 for freebsd-hackers-outgoing; Sat, 25 Apr 1998 03:43:20 -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 DAA10074 for ; Sat, 25 Apr 1998 03:43:16 -0700 (PDT) (envelope-from gurney_j@efn.org) Received: (from jmg@localhost) by d183-205.uoregon.edu (8.8.7/8.8.7) id DAA02866; Sat, 25 Apr 1998 03:43:13 -0700 (PDT) Message-ID: <19980425034313.55993@hydrogen.nike.efn.org> Date: Sat, 25 Apr 1998 03:43:13 -0700 From: John-Mark Gurney To: Robert Watson Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Context switch time References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.69 In-Reply-To: ; from Robert Watson on Sat, Apr 25, 1998 at 04:17:45AM -0400 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 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