Lockless uidinfo.
Pawel Jakub Dawidek
pjd at FreeBSD.org
Sun Aug 19 01:40:30 PDT 2007
On Sun, Aug 19, 2007 at 01:09:17AM +0200, Pawel Jakub Dawidek wrote:
> Ok, after implementing atomic_fetchadd_long() on amd64, we get additional
> 6% of performance improvement:
>
> x ./uidinfo_lockfree.txt (atomic_cmpset_long loop)
> + ./uidinfo_waitfree.txt (atomic_fetchadd_long)
> +------------------------------------------------------------------------------+
> | +|
> | +|
> |x xx xx + ++|
> | |__MA___| |AM|
> +------------------------------------------------------------------------------+
> N Min Max Median Avg Stddev
> x 5 1561566 1575987 1568964 1569767 5853.1399
> + 5 1662362 1665936 1665810 1664881.8 1541.2693
> Difference at 95.0% confidence
> 95114.8 +/- 6241.96
> 6.05917% +/- 0.397636%
> (Student's t, pooled s = 4279.88)
One more thing - comparsion between waitfree method and when chgsbsize()
is a no-op:
x ./uidinfo_waitfree.txt (atomic_fetchadd_long)
+ ./uidinfo_none.txt (no chgsbsize)
+------------------------------------------------------------------------------+
|x xx + + + + +|
| |AM| |_______M_A________| |
+------------------------------------------------------------------------------+
N Min Max Median Avg Stddev
x 5 1662362 1665936 1665810 1664881.8 1541.2693
+ 5 1718287 1744448 1726343 1728176.6 10271.936
Difference at 95.0% confidence
63294.8 +/- 10711.8
3.80176% +/- 0.643395%
(Student's t, pooled s = 7344.66)
This small speed up is of course because of atomics in waitfree case, but it
shows that we can't do much better than waitfree version, as ideal case is only
3.8% faster, at least for this benchmark.
This was for eight processes and this is for one:
x ./uidinfo_up_waitfree.txt (atomic_fetchadd_long)
+ ./uidinfo_up_none.txt (no chgsbsize)
+------------------------------------------------------------------------------+
|x x x x x + + +++|
| |______________M_____A_____________________| |_AM_||
+------------------------------------------------------------------------------+
N Min Max Median Avg Stddev
x 5 419799 431017 422877 424180.2 4265.4168
+ 5 433705 434955 434696 434509.6 519.68
Difference at 95.0% confidence
10329.4 +/- 4431.34
2.43514% +/- 1.04468%
(Student's t, pooled s = 3038.41)
This means that something else slows that eight processes case a bit, but it's
not uidinfo.
Ok, I need to stop, I need to stop right now!
--
Pawel Jakub Dawidek http://www.wheel.pl
pjd at FreeBSD.org http://www.FreeBSD.org
FreeBSD committer Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20070819/adc29f82/attachment.pgp
More information about the freebsd-arch
mailing list