Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Nov 2005 23:11:24 +0100
From:      Poul-Henning Kamp <phk@phk.freebsd.dk>
To:        current@freebsd.org
Subject:   proof-of-concept patch for cpu accounting speedup
Message-ID:  <6592.1133215884@critter.freebsd.dk>

next in thread | raw e-mail | index | archive | help

http://phk.freebsd.dk/patch/context_time.patch

This is just a proof of concept, it doesn't have all the tricky bits for
determining max TSC rate on machines where the cpu clock is fiddled with
and it doesn't have a fallback for machines without TSC etc etc.

But in your average i386 (and probably amd64) system it should work.


I am very interested to hear feedback and benchmarks of this patch.

The two most critical measurements are:
   *  "how does it affect workloads which do many context switches"
and
   *  "how does this affect CPU time accounting."

To measure the latter, make absolutely sure your machine doesn't play
power saving tricks with the TSC/cpu clock.


A quick sanity check reveals no obvious bogons in cpu time accounting
and unixbench's context1 switch shows 23% improvement on my testbox:

x _reference
+ _patched
+--------------------------------------------------------------------------+
|x  xx x                                                      +      ++  ++|
| |_AM_|                                                         |____A___||
+--------------------------------------------------------------------------+
    N           Min           Max        Median           Avg        Stddev
x   5         48370         49433         48997       48959.8     380.65693
+   5         59107         61079         60536       60376.4     786.45458
Difference at 95.0% confidence
        11416.6 +/- 901.059
        23.3183% +/- 1.84041%
        (Student's t, pooled s = 617.823)



-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6592.1133215884>