summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_witness.c
diff options
context:
space:
mode:
authorjkoshy <jkoshy@FreeBSD.org>2007-04-19 08:02:51 +0000
committerjkoshy <jkoshy@FreeBSD.org>2007-04-19 08:02:51 +0000
commit4552216c34c4f1ca0cc372e71dc0730938ed13e6 (patch)
treedd9b35590ac747ff50c76756b5fc730ccb2cbf86 /sys/kern/subr_witness.c
parent0119e5166b1153932858ac2977e6e9c1592aa8b7 (diff)
downloadFreeBSD-src-4552216c34c4f1ca0cc372e71dc0730938ed13e6.zip
FreeBSD-src-4552216c34c4f1ca0cc372e71dc0730938ed13e6.tar.gz
Fix witness(4) warnings about mutex use.
Group mutexes used in hwpmc(4) into 3 "types" in the sense of witness(4): - leaf spin mutexes---only one of these should be held at a time, so these mutexes are specified as belonging to a single witness type "pmc-leaf". - `struct pmc_owner' descriptors are protected by a spin mutex of witness type "pmc-owner-proc". Since we call wakeup_one() while holding these mutexes, the witness type of these mutexes needs to dominate that of "sleepq chain" mutexes. - logger threads use a sleep mutex, of type "pmc-sleep". Submitted by: wkoszek (earlier patch)
Diffstat (limited to 'sys/kern/subr_witness.c')
-rw-r--r--sys/kern/subr_witness.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c
index a5e666d..7224568 100644
--- a/sys/kern/subr_witness.c
+++ b/sys/kern/subr_witness.c
@@ -85,6 +85,7 @@
__FBSDID("$FreeBSD$");
#include "opt_ddb.h"
+#include "opt_hwpmc_hooks.h"
#include "opt_witness.h"
#include <sys/param.h>
@@ -289,6 +290,9 @@ static struct witness_order_list_entry order_lists[] = {
{ "session", &lock_class_mtx_sleep },
{ "uidinfo hash", &lock_class_mtx_sleep },
{ "uidinfo struct", &lock_class_mtx_sleep },
+#ifdef HWPMC_HOOKS
+ { "pmc-sleep", &lock_class_mtx_sleep },
+#endif
{ NULL, NULL },
/*
* Sockets
@@ -396,6 +400,9 @@ static struct witness_order_list_entry order_lists[] = {
{ "zstty", &lock_class_mtx_spin },
{ "fast_taskqueue", &lock_class_mtx_spin },
{ "intr table", &lock_class_mtx_spin },
+#ifdef HWPMC_HOOKS
+ { "pmc-per-proc", &lock_class_mtx_spin },
+#endif
{ "sleepq chain", &lock_class_mtx_spin },
{ "sched lock", &lock_class_mtx_spin },
{ "turnstile chain", &lock_class_mtx_spin },
@@ -434,6 +441,9 @@ static struct witness_order_list_entry order_lists[] = {
{ "tw_cl_io_lock", &lock_class_mtx_spin },
{ "tw_cl_intr_lock", &lock_class_mtx_spin },
{ "tw_cl_gen_lock", &lock_class_mtx_spin },
+#ifdef HWPMC_HOOKS
+ { "pmc-leaf", &lock_class_mtx_spin },
+#endif
{ NULL, NULL },
{ NULL, NULL }
};
OpenPOWER on IntegriCloud