Restore important comment in RCU/EPOCH support in FreeBSD after r355784.

Sponsored by:	Mellanox Technologies
This commit is contained in:
Hans Petter Selasky 2019-12-18 09:30:32 +00:00
parent 359a5f96a1
commit cc79ea3a26
2 changed files with 16 additions and 0 deletions

View File

@ -259,6 +259,15 @@ linux_synchronize_rcu_cb(ck_epoch_t *epoch __unused, ck_epoch_record_t *epoch_re
sched_prio(td, prio);
/* task switch */
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);
}
} else {

View File

@ -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);
}