diff options
author | kib <kib@FreeBSD.org> | 2015-02-28 04:19:02 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2015-02-28 04:19:02 +0000 |
commit | 8e556fe98aaec8f663dc85dcf7c632a2595b7789 (patch) | |
tree | 6927f903734161bc2d6ba87a115a0c175ec8f6c7 /sys/kern/kern_thr.c | |
parent | 3bce428c249e75423caf3932761bfcccc0664e30 (diff) | |
download | FreeBSD-src-8e556fe98aaec8f663dc85dcf7c632a2595b7789.zip FreeBSD-src-8e556fe98aaec8f663dc85dcf7c632a2595b7789.tar.gz |
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
Diffstat (limited to 'sys/kern/kern_thr.c')
-rw-r--r-- | sys/kern/kern_thr.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/kern/kern_thr.c b/sys/kern/kern_thr.c index b298f33..280bc0b 100644 --- a/sys/kern/kern_thr.c +++ b/sys/kern/kern_thr.c @@ -322,6 +322,7 @@ sys_thr_exit(struct thread *td, struct thr_exit_args *uap) LIST_REMOVE(td, td_hash); rw_wunlock(&tidhash_lock); tdsigcleanup(td); + umtx_thread_exit(td); PROC_SLOCK(p); thread_stopped(p); thread_exit(); |