Re: context switching pessimizations

From: Dag-Erling Smørgrav <des_at_ofug.org>
Date: Sun, 06 Apr 2003 14:09:43 +0200
Bruce Evans <bde_at_zeta.org.au> 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
-- 
Dag-Erling Smørgrav - des_at_ofug.org
Received on Sun Apr 06 2003 - 03:09:48 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:02 UTC