Fix a bug in synchronize RCU when the calling thread is bound to a CPU.

Set "td_pinned" to zero after "sched_unbind()" to prevent "td_pinned"
from temporarily becoming negative during "sched_bind()". This can
happen if "sched_bind()" uses "sched_pin()" and "sched_unpin()".

MFC after:	1 week
Sponsored by:	Mellanox Technologies
This commit is contained in:
Hans Petter Selasky 2017-07-07 13:15:00 +00:00
parent a90f44b281
commit ea16525413
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=320774

View File

@ -299,8 +299,9 @@ linux_synchronize_rcu(void)
old_cpu = PCPU_GET(cpuid); old_cpu = PCPU_GET(cpuid);
old_pinned = td->td_pinned; old_pinned = td->td_pinned;
old_prio = td->td_priority; old_prio = td->td_priority;
td->td_pinned = 0;
was_bound = sched_is_bound(td); was_bound = sched_is_bound(td);
sched_unbind(td);
td->td_pinned = 0;
sched_bind(td, old_cpu); sched_bind(td, old_cpu);
ck_epoch_synchronize_wait(&linux_epoch, ck_epoch_synchronize_wait(&linux_epoch,