summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2016-12-02 22:27:54 +0000
committerjhb <jhb@FreeBSD.org>2016-12-02 22:27:54 +0000
commit70acdb3c608c1ee620d76ee8c24ca0122622ccd0 (patch)
treef47ebdf7624f111dae70e0bfb4bd57579703c561 /share
parent7d0825c3c919722ff1207a34242d93943f6b621e (diff)
downloadFreeBSD-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 'share')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud