]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Drop the kqueue global mutex as soon as we are finished with it rather
authorJohn Baldwin <jhb@FreeBSD.org>
Fri, 14 Apr 2006 14:27:28 +0000 (14:27 +0000)
committerJohn Baldwin <jhb@FreeBSD.org>
Fri, 14 Apr 2006 14:27:28 +0000 (14:27 +0000)
commita29b4f6eecf0d0325a3bd06afe148a147201297e
tree63f86e7f51f31342ce7d52b2a8530a76bbb5453e
parent62463f6768ad65fcc6355aa06e09de20c42aec7f
Drop the kqueue global mutex as soon as we are finished with it rather
than keeping it locked until we exit the function to optimize the case
where the lock would be dropped and later reacquired.  The optimization
was broken when kevent's were moved from UFS to VFS and the knote list
lock for a vnode kevent became the lockmgr vnode lock.  If one tried
to use a kqueue that contained events for a kqueue fd followed by a vnode,
then the kq global lock would end up being held when the vnode lock was
acquired which could result in sleeping with a mutex held (and subsequent
panics) if the vnode lock was contested.

Reviewed by: jmg
Tested by: ps (on 6.x)
MFC after: 3 days
sys/kern/kern_event.c