Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Dec 2004 23:50:11 -0500
From:      Suleiman Souhlal <ssouhlal@FreeBSD.org>
To:        Max Laier <max@love2party.net>
Cc:        freebsd-arch@FreeBSD.org
Subject:   Re: sysctl locking
Message-ID:  <21F934EB-4FE7-11D9-B1F7-000A95C4D7BC@FreeBSD.org>
In-Reply-To: <200412131232.55051.max@love2party.net>
References:  <94AE3F5A-4CD6-11D9-8BD6-000A95C4D7BC@FreeBSD.org> <200412130913.20215.max@love2party.net> <200412131232.55051.max@love2party.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Hello,

On Dec 13, 2004, at 6:32 AM, Max Laier wrote:

> 1) Extend sysctl_add_oid() to accept an additional mutex argument.
> 2) Extend the simple sysctl handler to use this mutex to protect the 
> actual
>    write(?read?). We must not hold the mutex during the useland copy 
> in/out so
>    we must move to temporary storage.
> 3) To maintain the current API and behavior we use &Giant as the 
> default
>    fallback argument. This might need some extension for complex 
> handler (i.e.
>    no mutex given -> acquire Giant before calling the complex handler).
>
> What do people think of this? Does it make any sense? Should we be 
> concerned
> at all? Does the extension make sense? Comments?

I have implemented this. The diff is at 
http://people.freebsd.org/~ssouhlal/sysctl-sx-locking-20041214.diff
It also needs the patch at 
http://people.freebsd.org/~ssouhlal/sx_xlocked.diff which introduces a 
sx_xlocked() function.

Unfortunately, we still need to look at every single SYSCTL_PROC, and 
make either grab Giant, lock correctly, or make sure it doesn't need 
any locking. :(

--
Suleiman Souhlal     | ssouhlal@vt.edu
The FreeBSD Project  | ssouhlal@FreeBSD.org

_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?21F934EB-4FE7-11D9-B1F7-000A95C4D7BC>