From owner-freebsd-current@FreeBSD.ORG Sun Apr 6 05:09:48 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 5B48137B401; Sun, 6 Apr 2003 05:09:46 -0700 (PDT) Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7F5A743FD7; Sun, 6 Apr 2003 05:09:45 -0700 (PDT) (envelope-from des@ofug.org) Received: by flood.ping.uio.no (Postfix, from userid 2602) id E64BF5309; Sun, 6 Apr 2003 14:09:43 +0200 (CEST) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: Bruce Evans From: des@ofug.org (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Sun, 06 Apr 2003 14:09:43 +0200 In-Reply-To: <20030405204940.L800@gamplex.bde.org> (Bruce Evans's message of "Sat, 5 Apr 2003 20:52:31 +1000 (EST)") Message-ID: User-Agent: Gnus/5.090015 (Oort Gnus v0.15) Emacs/21.2 References: <20030405194620.I645@gamplex.bde.org> <20030405204940.L800@gamplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable cc: current@freebsd.org cc: peter@freebsd.org Subject: Re: 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: Sun, 06 Apr 2003 12:09:48 -0000 Bruce Evans writes: > On Sat, 5 Apr 2003, Bruce Evans wrote: > > Recent optimizations of context switching are large pessimizations > > according to lmbench2, at least in the default case (no LAZY_SWITCH). > The ifdefs are just so convoluted that they are broken in the > !LAZY_SWITCH case. I ran lmbench2 on the same machine with three versions of the same kernel (same sources, same config, built with the same compiler) - one without your !LAZY_SWITCH patch - one with your patch but no lazy switching - one with your patch and LAZY_SWITCH enabled The benchmark was run three times in rapid succession on each kernel. In each case I stopped X and cron before running the benchmark, so nothing of significance was running but lmbench2. In each of the tables below, the first three lines are without the patch, the middle three are with the patch but no lazy switching, the last three are with lazy switching. 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 --------- ------------- ----- ------ ------ ------ ------ ------- ------- dwp.think FreeBSD 5.0-C 24.5 28.9 141.8 82.3 235.2 93.6 233.7 dwp.think FreeBSD 5.0-C 13.6 35.7 145.1 81.5 235.3 94.1 234.5 dwp.think FreeBSD 5.0-C 24.4 24.6 147.4 85.5 234.4 93.8 234.0 dwp.think FreeBSD 5.0-C 24.5 25.5 146.7 84.7 234.7 94.3 233.8 dwp.think FreeBSD 5.0-C 31.4 27.6 143.4 80.9 232.4 93.8 232.8 dwp.think FreeBSD 5.0-C 24.6 24.2 145.7 81.9 234.7 94.0 233.4 dwp.think FreeBSD 5.0-C 25.1 24.4 146.3 83.0 236.9 95.6 236.1 dwp.think FreeBSD 5.0-C 25.1 36.5 144.6 84.8 237.9 95.1 237.0 dwp.think FreeBSD 5.0-C 13.7 41.8 144.1 83.9 236.9 95.4 236.7 *Local* Communication latencies in microseconds - smaller is better ------------------------------------------------------------------- Host OS 2p/0K Pipe AF UDP RPC/ TCP RPC/ TCP ctxsw UNIX UDP TCP conn --------- ------------- ----- ----- ---- ----- ----- ----- ----- ---- dwp.think FreeBSD 5.0-C 24.5 74.8 121. 206.3 377.4 185.3 384.6 597. dwp.think FreeBSD 5.0-C 13.6 104.8 96.8 204.9 378.4 191.6 314.1 635. dwp.think FreeBSD 5.0-C 24.4 105.9 119. 196.4 371.3 182.1 349.6 606. dwp.think FreeBSD 5.0-C 24.5 106.1 105. 202.8 383.3 188.3 351.6 636. dwp.think FreeBSD 5.0-C 31.4 107.3 87.5 206.1 386.4 225.5 358.4 600. dwp.think FreeBSD 5.0-C 24.6 106.0 122. 200.2 394.2 211.1 363.1 692. dwp.think FreeBSD 5.0-C 25.1 107.5 130. 195.1 384.1 210.4 364.2 598. dwp.think FreeBSD 5.0-C 25.1 108.6 91.2 196.8 371.3 183.2 312.3 593. dwp.think FreeBSD 5.0-C 13.7 86.0 90.7 196.0 383.3 219.2 313.5 600. I'll leave you to draw your own conclusions... DES --=20 Dag-Erling Sm=F8rgrav - des@ofug.org