concurrent sysctl implementation

John Baldwin jhb at freebsd.org
Mon May 11 16:49:42 UTC 2009


On Friday 08 May 2009 5:41:17 pm Ed Schouten wrote:
> A solution would be to solve it as follows:
> 
> - Use a semaphore, initialized to some insane high value to put an upper
>   limit on the amount of concurrent sysctl calls. I'm not sure whether
>   this is really needed. Maybe this issue is not as serious as we think
>   it is.

Well, one compromise might be to allow concurrent userland requests if the 
buffer size is small (say < 1 page).  This would be a quite simple change and 
would cover many common syscalls like fetching an int which don't wire memory 
anyway.

> - Use an rw/rm/sxlock to protect the sysctl tree, but only pick up
>   the lock when we traverse parts of the sysctl tree that has
>   dynamically created entries.

I don't think further work is needed here for the tree, notice that in-kernel 
sysctls are already concurrent and use a read lock on the tree.

-- 
John Baldwin


More information about the freebsd-hackers mailing list