diff options
author | Hans Petter Selasky <hselasky@FreeBSD.org> | 2019-12-18 09:30:32 +0000 |
---|---|---|
committer | Hans Petter Selasky <hselasky@FreeBSD.org> | 2019-12-18 09:30:32 +0000 |
commit | cc79ea3a2650a5401ec756cecc4a0685f839efe6 (patch) | |
tree | fcaa506d1794796f49601fbccf6c0653905cd99b /sys/kern/subr_epoch.c | |
parent | 359a5f96a1685f6779e7ddbe5daafd67e73a066e (diff) | |
download | src-cc79ea3a2650a5401ec756cecc4a0685f839efe6.tar.gz src-cc79ea3a2650a5401ec756cecc4a0685f839efe6.zip |
Notes
Diffstat (limited to 'sys/kern/subr_epoch.c')
-rw-r--r-- | sys/kern/subr_epoch.c | 7 |
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); } |