Re: Spinlock thrashing with libthr

From: Kris Kennaway <kris_at_obsecurity.org>
Date: Fri, 14 Apr 2006 19:17:59 -0400
On Fri, Apr 14, 2006 at 06:43:18PM -0400, Kris Kennaway wrote:
> I ran a modified version of the thr1 stress test on a quad amd64,
> which spawns 256 threads (using libthr), each of which loops doing
> getpid() 10000 times.  The system spends essentially 100% of the time
> in the kernel.  Profiling with hwpmc shows that the system is spending
> about 60% time in _mtx_lock_spin().

Turns out this is because of contention for the PROC_LOCK, which means
lots of processes sleeping.  Using getuid() instead (which doesn't
acquire locks) does not show contention.  Thanks to rwatson for
figuring it out.

Kris
Received on Fri Apr 14 2006 - 21:18:00 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:54 UTC