]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Decompose the global UNIX domain sockets rwlock into two different
authorrwatson <rwatson@FreeBSD.org>
Sun, 8 Mar 2009 21:48:29 +0000 (21:48 +0000)
committerrwatson <rwatson@FreeBSD.org>
Sun, 8 Mar 2009 21:48:29 +0000 (21:48 +0000)
commit4aae6c65e1e1c2d8880efec7827bfcbc87d7c447
treea56ab174dbef763f18c8c408b4076028c0137a39
parentea13322a872997d5681cd94bb4571a43692f86e4
Decompose the global UNIX domain sockets rwlock into two different
locks: a global list/counter/generation counter protected by a new
mutex unp_list_lock, and a global linkage rwlock, unp_global_rwlock,
which protects the connections between UNIX domain sockets.

This eliminates conditional lock acquisition that was previously a
property of the global lock being held over sonewconn() leading to a
call to uipc_attach(), which also required the global lock, but
couldn't rely on it as other paths existed to uipc_attach() that
didn't hold it: now uipc_attach() uses only the list lock, which
follows the linkage lock in the lock order.  It may also reduce
contention on the global lock for some workloads.

Add global UNIX domain socket locks to hard-coded witness lock
order.

MFC after: 1 week
Discussed with: kris
sys/kern/subr_witness.c
sys/kern/uipc_usrreq.c