Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 May 2006 09:35:54 +0800
From:      David Xu <davidxu@freebsd.org>
To:        freebsd-threads@freebsd.org
Subject:   optimize msleep with PCATCH flag
Message-ID:  <200605200935.54828.davidxu@freebsd.org>

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

Here is a patch to reduce overhead when PCATCH flag is set
for msleep.
http://people.freebsd.org/~davidxu/patch/PCATCH_optimize.patch

I use SUN's mutex ping-pong program to test it, source code
is here: http://people.freebsd.org/~davidxu/bench/pp.c

I have tested it on a dual PIII machine, with command:
./pp -v -s system -n 4
 
Here is the result before and after the patch:

x plain_PCATCH.txt
+ PCATCH_optimized.txt
+--------------------------------------------------------------------------+
|+     +            +    x     ++  +*   xx    x  x         *              x|
|        |__________________A__|M___________M_|______________|             |
+--------------------------------------------------------------------------+
    N           Min           Max        Median           Avg        Stddev
x   8         35311         41714       37750.5         38101     1954.5673
+   8         32191         39802         36179     35670.125      2401.755
Difference at 95.0% confidence
	-2430.88 +/- 2348.35
	-6.38008% +/- 6.1635%
	(Student's t, pooled s = 2189.61)

David Xu



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