From owner-freebsd-current@FreeBSD.ORG Sat Apr 5 02:12:22 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BFBD037B401; Sat, 5 Apr 2003 02:12:22 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6912343FBF; Sat, 5 Apr 2003 02:12:21 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id UAA09492; Sat, 5 Apr 2003 20:12:18 +1000 Date: Sat, 5 Apr 2003 20:12:17 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: current@freebsd.org Message-ID: <20030405194620.I645@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: peter@freebsd.org Subject: context switching pessimizations X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2003 10:12:23 -0000 Recent optimizations of context switching are large pessimizations according to lmbench2, at least in the default case (no LAZY_SWITCH). >From lmbench2 output on an AthlonXP-1600 overclocked with no acpi (so the timecounter is the TSC and doesn't pessimize context switching all by itself), and no debugging options like INVARIANTS of course: %%% Context switching - times in microseconds - smaller is better ------------------------------------------------------------- Host OS 2p/0K 2p/16K 2p/64K 8p/16K 8p/64K 16p/16K 16p/64K ctxsw ctxsw ctxsw ctxsw ctxsw ctxsw ctxsw --------- ------------- ----- ------ ------ ------ ------ ------- ------- besplex.b FreeBSD 4.5-S 0.540 1.1000 11.2 3.3600 82.0 9.22000 82.0 besplex.b FreeBSD 4.7-S 0.610 1.1900 11.3 3.8300 81.8 8.57000 81.7 bes4.bde. FreeBSD 5.0-C 1.020 2.3800 12.5 4.5000 83.8 16.2 84.6 bes4.bde. FreeBSD 5.0-C 1.780 3.7400 12.9 6.2000 87.1 20.8 87.5 bes4.bde. FreeBSD 5.0-C 2.650 3.6000 12.9 6.2900 87.1 19.0 87.5 *Local* Communication latencies in microseconds - smaller is better ------------------------------------------------------------------- Host OS 2p/0K Pipe AF UDP RPC/ TCP RPC/ TCP ctxsw UNIX UDP TCP conn --------- ------------- ----- ----- ---- ----- ----- ----- ----- ---- besplex.b FreeBSD 4.5-S 0.540 3.222 4.09 8.923 20.2 10.2 28.2 besplex.b FreeBSD 4.7-S 0.610 3.397 4.41 9.216 22.9 10.2 28.0 bes4.bde. FreeBSD 5.0-C 1.020 4.780 5.84 16.5 40.3 17.5 42.0 56.3 bes4.bde. FreeBSD 5.0-C 1.780 10.2 11.9 25.4 46.1 22.8 46.4 64.6 bes4.bde. FreeBSD 5.0-C 2.650 10.2 12.1 23.4 45.5 25.1 46.2 65.3 %%% The first of each set of bes4's is for -current on Jan 3. The second is for today's -current with SCHED_ULE and the third is for today's -current with SCHED_4BSD. The other lines are for the indicated versions of stable. The comm. latency benchmarks use context switching so they are slower too. Some of the other benchmarks are slower, but the cause is not as obvious as for the comm. latency ones. Bruce