From owner-freebsd-current@FreeBSD.ORG Wed Feb 11 07:23:14 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D9C8106566B for ; Wed, 11 Feb 2009 07:23:14 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 0AA9C8FC20 for ; Wed, 11 Feb 2009 07:23:14 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id CCD7A1CCE1; Wed, 11 Feb 2009 08:23:12 +0100 (CET) Date: Wed, 11 Feb 2009 08:23:12 +0100 From: Ed Schouten To: pluknet Message-ID: <20090211072312.GL68388@hoeg.nl> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="S6vg04ofUPzW4qJg" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Cc: FreeBSD Current Subject: Contention on sysctl lock 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: Wed, 11 Feb 2009 07:23:14 -0000 --S6vg04ofUPzW4qJg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, * pluknet wrote: > Any commands I tried then lock on sysctl lock; i.e. ctrl+t returns: > load: 0.04 cmd: sudo 1008 [sysctl lock] 0.00u 0.00s 0% 312k The problem with sysctl's current implementation is that all calls to sysctl() are protected with an sx lock, sysctl lock. This means that if one call to sysctl() gets blocked on a different lock (one of GEOM's in this case), all further calls get blocked as well. Because we call sysctl() on process creation (to obtain a random number for the stack protector), this becomes a mess. Some time ago I was thinking it shouldn't be all that hard to make sysctl() lockless for any sysctls that aren't created dynamically. I still have to find some time to implement this. --=20 Ed Schouten WWW: http://80386.nl/ --S6vg04ofUPzW4qJg Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkmSfOAACgkQ52SDGA2eCwVZxwCggOhrj9vN1Rg3CVTuI4GX6IzH pGQAnRUMrwZk+gPdBi0axv1LMwxuPBXy =FroI -----END PGP SIGNATURE----- --S6vg04ofUPzW4qJg--