aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/subr_epoch.c
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2019-12-18 09:30:32 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2019-12-18 09:30:32 +0000
commitcc79ea3a2650a5401ec756cecc4a0685f839efe6 (patch)
treefcaa506d1794796f49601fbccf6c0653905cd99b /sys/kern/subr_epoch.c
parent359a5f96a1685f6779e7ddbe5daafd67e73a066e (diff)
downloadsrc-cc79ea3a2650a5401ec756cecc4a0685f839efe6.tar.gz
src-cc79ea3a2650a5401ec756cecc4a0685f839efe6.zip
Notes
Diffstat (limited to 'sys/kern/subr_epoch.c')
-rw-r--r--sys/kern/subr_epoch.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/kern/subr_epoch.c b/sys/kern/subr_epoch.c
index 7d04bb92928c..a2b99d12a390 100644
--- a/sys/kern/subr_epoch.c
+++ b/sys/kern/subr_epoch.c
@@ -578,6 +578,13 @@ epoch_block_handler_preempt(struct ck_epoch *global __unused,
*/
counter_u64_add(switch_count, 1);
mi_switch(SW_VOL | SWT_RELINQUISH);
+ /*
+ * It is important the thread lock is dropped while yielding
+ * to allow other threads to acquire the lock pointed to by
+ * TDQ_LOCKPTR(td). Currently mi_switch() will unlock the
+ * thread lock before returning. Else a deadlock like
+ * situation might happen.
+ */
thread_lock(td);
}