From owner-freebsd-current@FreeBSD.ORG Fri Apr 14 23:18:00 2006 Return-Path: X-Original-To: current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9F06F16A401; Fri, 14 Apr 2006 23:18:00 +0000 (UTC) (envelope-from kris@obsecurity.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5F99243D46; Fri, 14 Apr 2006 23:18:00 +0000 (GMT) (envelope-from kris@obsecurity.org) Received: from obsecurity.dyndns.org (elvis.mu.org [192.203.228.196]) by elvis.mu.org (Postfix) with ESMTP id 47BBA1A4DD7; Fri, 14 Apr 2006 16:18:00 -0700 (PDT) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id A721551878; Fri, 14 Apr 2006 19:17:59 -0400 (EDT) Date: Fri, 14 Apr 2006 19:17:59 -0400 From: Kris Kennaway To: Kris Kennaway Message-ID: <20060414231759.GA9342@xor.obsecurity.org> References: <20060414224318.GA8716@xor.obsecurity.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DocE+STaALJfprDB" Content-Disposition: inline In-Reply-To: <20060414224318.GA8716@xor.obsecurity.org> User-Agent: Mutt/1.4.2.1i Cc: current@FreeBSD.org, jhb@FreeBSD.org, davidxu@FreeBSD.org Subject: Re: Spinlock thrashing with libthr X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2006 23:18:00 -0000 --DocE+STaALJfprDB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --DocE+STaALJfprDB Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (FreeBSD) iD8DBQFEQC2mWry0BWjoQKURAq8+AJ0XHb7RDvSoJVyINoQUoP4BXTvR6ACdGcUY Zw/TgTZjUNXbmJdYIQZAjA0= =oXy5 -----END PGP SIGNATURE----- --DocE+STaALJfprDB--