diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-08-13 21:21:34 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-08-13 21:21:34 +0300 |
commit | 2406fb8d94fb17fee3ace0c09427c08825eacb16 (patch) | |
tree | e9ed5a5d03b02701e12002ef0d50b6829ddc6ce2 | |
parent | 37a16046800c29a8ca1ebe26086e363494062a17 (diff) | |
parent | cfd355145c32bb7ccb65fccbe2d67280dc2119e1 (diff) | |
download | linux-2406fb8d94fb17fee3ace0c09427c08825eacb16.tar.xz |
Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull scheduler fix from Thomas Gleixner:
"A single bugfix to prevent a pinned thread which queues stomp machine
work to be preempted by the stopper thread on its CPU which causes a
live lock as it is unable to wake the second CPUs stopper thread"
* 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
stop_machine: Atomically queue and wake stopper threads
-rw-r--r-- | kernel/stop_machine.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c index e190d1ef3a23..69eb76daed34 100644 --- a/kernel/stop_machine.c +++ b/kernel/stop_machine.c @@ -81,6 +81,7 @@ static bool cpu_stop_queue_work(unsigned int cpu, struct cpu_stop_work *work) unsigned long flags; bool enabled; + preempt_disable(); raw_spin_lock_irqsave(&stopper->lock, flags); enabled = stopper->enabled; if (enabled) @@ -90,6 +91,7 @@ static bool cpu_stop_queue_work(unsigned int cpu, struct cpu_stop_work *work) raw_spin_unlock_irqrestore(&stopper->lock, flags); wake_up_q(&wakeq); + preempt_enable(); return enabled; } |