Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 09 May 2005 16:09:55 -0500
From:      Jonathan Noack <noackjr@alumni.rice.edu>
To:        noackjr@alumni.rice.edu
Cc:        Pete French <petefrench@ticketswitch.com>
Subject:   Re: Performance issue
Message-ID:  <427FD1A3.8080604@alumni.rice.edu>
In-Reply-To: <427FAC30.80507@alumni.rice.edu>
References:  <E1DVC6B-000FgV-9j@dilbert.firstcallgroup.co.uk> <427FAC30.80507@alumni.rice.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig23600E04914CE7DF0DF3E261
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

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@alumni.rice.edu | OpenPGP: 0x991D8195

--------------enig23600E04914CE7DF0DF3E261
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)

iD8DBQFCf9GnUFz01pkdgZURAmf+AJ9cF7riEe7Nb/qMzsokYx69j62K/wCfc+IO
pdyDKB9XRO0B6BNX4ilUDsg=
=l0X/
-----END PGP SIGNATURE-----

--------------enig23600E04914CE7DF0DF3E261--



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