summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_witness.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2009-03-08 21:48:29 +0000
committerrwatson <rwatson@FreeBSD.org>2009-03-08 21:48:29 +0000
commit4aae6c65e1e1c2d8880efec7827bfcbc87d7c447 (patch)
treea56ab174dbef763f18c8c408b4076028c0137a39 /sys/kern/subr_witness.c
parentea13322a872997d5681cd94bb4571a43692f86e4 (diff)
downloadFreeBSD-src-4aae6c65e1e1c2d8880efec7827bfcbc87d7c447.zip
FreeBSD-src-4aae6c65e1e1c2d8880efec7827bfcbc87d7c447.tar.gz
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
Diffstat (limited to 'sys/kern/subr_witness.c')
-rw-r--r--sys/kern/subr_witness.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c
index c7a5b9d..2db8e07 100644
--- a/sys/kern/subr_witness.c
+++ b/sys/kern/subr_witness.c
@@ -522,6 +522,8 @@ static struct witness_order_list_entry order_lists[] = {
/*
* UNIX Domain Sockets
*/
+ { "unp_global_rwlock", &lock_class_rw },
+ { "unp_list_lock", &lock_class_mtx_sleep },
{ "unp", &lock_class_mtx_sleep },
{ "so_snd", &lock_class_mtx_sleep },
{ NULL, NULL },
OpenPOWER on IntegriCloud