Code must not unlock a mutex while owning the thread lock.

Reviewed by:	hselasky, markj
Sponsored by:	Mellanox Technologies
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D23150
This commit is contained in:
Konstantin Belousov 2020-01-13 14:30:19 +00:00
parent 5452c16c21
commit fedab1b499
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=356682
2 changed files with 2 additions and 3 deletions

View File

@ -298,6 +298,7 @@ linux_synchronize_rcu(void)
"linux_synchronize_rcu() can sleep");
td = curthread;
DROP_GIANT();
/*
* Synchronizing RCU might change the CPU core this function
@ -305,8 +306,6 @@ linux_synchronize_rcu(void)
*/
thread_lock(td);
DROP_GIANT();
old_cpu = PCPU_GET(cpuid);
old_pinned = td->td_pinned;
old_prio = td->td_priority;

View File

@ -610,8 +610,8 @@ epoch_wait_preempt(epoch_t epoch)
KASSERT(!in_epoch(epoch), ("epoch_wait_preempt() called in the middle "
"of an epoch section of the same epoch"));
#endif
thread_lock(td);
DROP_GIANT();
thread_lock(td);
old_cpu = PCPU_GET(cpuid);
old_pinned = td->td_pinned;