Performance issue
Jonathan Noack
noackjr at alumni.rice.edu
Mon May 9 14:10:08 PDT 2005
On 5/9/2005 1:30 PM, Jonathan Noack wrote:
> On 5/9/2005 12:31 PM, Pete French wrote:
>>> 5.3 ships with SMP turned on, which makes lock operations rather
>>> expensive on single-processor machines. 4.x does not have SMP
>>> turned on by default. Would you be able to re-run your test with
>>> SMP turned off?
>>
>> I just ran a test here with SMP turned of on 5.4-RC4 (GENERIC) I got the
>> following result:
>>
>> 67.52 real 41.13 user 26.16 sys
>> 7034 involuntary context switches
>>
>> i.e. it still has system time a a huge proportion of the total compared
>> to the 4.11 kernel. Interesingly, after reading Holger Kipp's results
>> I tried it on a genuine multi-processor box with SMP enabled running 5.3.
>> He got a very small percentage of the time in sys (3.51 out of 81.90) but
>> I got:
>> 255.30 real 160.20 user 88.50 sys
>>
>> Once again a far higher proprtion of the time spent in sys than you would
>> expect.
>
> I ran into a similar issue when attempting to thread a card game solver
> program I wrote. Performance in early versions was horrific and I
> noticed tons of context switches. I resolved the issue by allocating
> pools of memory beforehand. This seems to point the finger to malloc
> and context switch overhead.
>
> In any case, I believe this is related to threading. Check your results
> with libthr instead. The following are on my 2.53 GHz P4 which is
> running CURRENT from last night (with INVARIANTS on).
>
> libpthread:
> $ /usr/bin/time -al ./heapsort.py 1000000
> 0.9999928555
> 124.04 real 65.71 user 48.47 sys
> 23464 maximum resident set size
> 680 average shared memory size
> 21104 average unshared data size
> 129 average unshared stack size
> 5400 page reclaims
> 0 page faults
> 0 swaps
> 15 block input operations
> 0 block output operations
> 4 messages sent
> 0 messages received
> 0 signals received
> 21 voluntary context switches
> 40274 involuntary context switches
>
> libthr:
> $ /usr/bin/time -al ./heapsort.py 1000000
> 0.9999928555
> 79.75 real 50.63 user 25.34 sys
> 23348 maximum resident set size
> 679 average shared memory size
> 21041 average unshared data size
> 129 average unshared stack size
> 5394 page reclaims
> 1 page faults
> 0 swaps
> 2 block input operations
> 0 block output operations
> 3 messages sent
> 0 messages received
> 0 signals received
> 7 voluntary context switches
> 26113 involuntary context switches
Oooh... same machine with libc_r:
$ /usr/bin/time -al ./heapsort.py 1000000
0.9999928555
38.72 real 36.85 user 0.06 sys
23496 maximum resident set size
678 average shared memory size
21126 average unshared data size
129 average unshared stack size
5418 page reclaims
2 page faults
0 swaps
2 block input operations
0 block output operations
3 messages sent
0 messages received
0 signals received
8 voluntary context switches
13137 involuntary context switches
--
Jonathan Noack | noackjr at alumni.rice.edu | OpenPGP: 0x991D8195
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20050509/7ac50b21/signature.bin
More information about the freebsd-stable
mailing list