Contention on sysctl lock

Ed Schouten ed at 80386.nl
Tue Feb 10 23:23:14 PST 2009


Hello,

* pluknet <pluknet at 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.

-- 
 Ed Schouten <ed at 80386.nl>
 WWW: http://80386.nl/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20090211/2161fd10/attachment.pgp


More information about the freebsd-current mailing list