diff options
author | jhb <jhb@FreeBSD.org> | 2016-12-02 22:27:54 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2016-12-02 22:27:54 +0000 |
commit | 70acdb3c608c1ee620d76ee8c24ca0122622ccd0 (patch) | |
tree | f47ebdf7624f111dae70e0bfb4bd57579703c561 /contrib/diff/src | |
parent | 7d0825c3c919722ff1207a34242d93943f6b621e (diff) | |
download | FreeBSD-src-70acdb3c608c1ee620d76ee8c24ca0122622ccd0.zip FreeBSD-src-70acdb3c608c1ee620d76ee8c24ca0122622ccd0.tar.gz |
MFC 308564: Don't place threads on the run queue after waking up other CPUs.
The other CPU might resume and see a still-empty runq and go back to
sleep before sched_add() adds the thread to the runq. This results
in a lost wakeup and a potential hang if the system is otherwise
completely idle.
The race originated due to a micro-optimization (my fault) in 4BSD in
that it avoided putting a thread on the run queue if the scheduler was
going to preempt to the new thread. To avoid complexity while fixing
this race, just drop this optimization. 4BSD now always sets the
"owepreempt" flag when a preemption is warranted and defers the actual
preemption to the thread_unlock of the caller the same as ULE.
Diffstat (limited to 'contrib/diff/src')
0 files changed, 0 insertions, 0 deletions