Date: Wed, 11 Feb 2009 08:23:12 +0100 From: Ed Schouten <ed@80386.nl> To: pluknet <pluknet@gmail.com> Cc: FreeBSD Current <freebsd-current@freebsd.org> Subject: Contention on sysctl lock Message-ID: <20090211072312.GL68388@hoeg.nl> In-Reply-To: <a31046fc0902101213t6dcd6a39j625bc8e4927157e5@mail.gmail.com> References: <a31046fc0902101213t6dcd6a39j625bc8e4927157e5@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--S6vg04ofUPzW4qJg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, * pluknet <pluknet@gmail.com> 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 <ed@80386.nl> 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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090211072312.GL68388>