aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/subr_witness.c
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2015-02-28 04:19:02 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2015-02-28 04:19:02 +0000
commit13dad108711bc127409ad7985aade0afce873743 (patch)
tree6927f903734161bc2d6ba87a115a0c175ec8f6c7 /sys/kern/subr_witness.c
parentc483877531068b3bf30bdc02a103c1fa2b57a215 (diff)
downloadsrc-13dad108711bc127409ad7985aade0afce873743.tar.gz
src-13dad108711bc127409ad7985aade0afce873743.zip
The umtx_lock mutex is used by top-half of the kernel, but is
currently a spin lock. Apparently, the only reason for this is that umtx_thread_exit() is called under the process spinlock, which put the requirement on the umtx_lock. Note that the witness static order list is wrong for the umtx_lock, umtx_lock is explicitely before any thread lock, so it is also before sleepq locks. Change umtx_lock to be the sleepable mutex. For the reason above, the calls to umtx_thread_exit() are moved from thread_exit() earlier in each caller, when the process spin lock is not yet taken. Discussed with: jhb Tested by: pho (previous version) Sponsored by: The FreeBSD Foundation MFC after: 3 weeks
Notes
Notes: svn path=/head/; revision=279390
Diffstat (limited to 'sys/kern/subr_witness.c')
-rw-r--r--sys/kern/subr_witness.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c
index 518fb492b075..f80026a32d43 100644
--- a/sys/kern/subr_witness.c
+++ b/sys/kern/subr_witness.c
@@ -492,6 +492,11 @@ static struct witness_order_list_entry order_lists[] = {
{ "time lock", &lock_class_mtx_sleep },
{ NULL, NULL },
/*
+ * umtx
+ */
+ { "umtx lock", &lock_class_mtx_sleep },
+ { NULL, NULL },
+ /*
* Sockets
*/
{ "accept", &lock_class_mtx_sleep },
@@ -637,7 +642,6 @@ static struct witness_order_list_entry order_lists[] = {
#endif
{ "process slock", &lock_class_mtx_spin },
{ "sleepq chain", &lock_class_mtx_spin },
- { "umtx lock", &lock_class_mtx_spin },
{ "rm_spinlock", &lock_class_mtx_spin },
{ "turnstile chain", &lock_class_mtx_spin },
{ "turnstile lock", &lock_class_mtx_spin },