Date: Mon, 09 May 2005 13:30:08 -0500 From: Jonathan Noack <noackjr@alumni.rice.edu> To: Pete French <petefrench@ticketswitch.com> Cc: freebsd-stable@freebsd.org Subject: Re: Performance issue Message-ID: <427FAC30.80507@alumni.rice.edu> In-Reply-To: <E1DVC6B-000FgV-9j@dilbert.firstcallgroup.co.uk> References: <E1DVC6B-000FgV-9j@dilbert.firstcallgroup.co.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigB6A928D6BCE7C441FFD030C7 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 -- Jonathan Noack | noackjr@alumni.rice.edu | OpenPGP: 0x991D8195 --------------enigB6A928D6BCE7C441FFD030C7 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) iD8DBQFCf6w2UFz01pkdgZURAr7RAJ9U3PAxGomUX0HaXRsILc/9uY6qgQCfYX5c vrUq5/raktNR2dEET31sGwY= =8+6v -----END PGP SIGNATURE----- --------------enigB6A928D6BCE7C441FFD030C7--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?427FAC30.80507>