]> git.ipfire.org Git - thirdparty/linux.git/commit - kernel/stop_machine.c
stop_machine: Reflow cpu_stop_queue_two_works()
authorPeter Zijlstra <peterz@infradead.org>
Mon, 30 Jul 2018 11:21:40 +0000 (13:21 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 2 Aug 2018 13:25:20 +0000 (15:25 +0200)
commitb80a2bfce85e1051056d98d04ecb2d0b55cbbc1c
tree14df7b9e65a904bdd3e5126cdd494e9ec16affa9
parentb6a60cf36d497e7fbde9dd5b86fabd96850249f6
stop_machine: Reflow cpu_stop_queue_two_works()

The code flow in cpu_stop_queue_two_works() is a little arcane; fix this by
lifting the preempt_disable() to the top to create more natural nesting wrt
the spinlocks and make the wake_up_q() and preempt_enable() unconditional
at the end.

Furthermore, enable preemption in the -EDEADLK case, such that we spin-wait
with preemption enabled.

Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: isaacm@codeaurora.org
Cc: matt@codeblueprint.co.uk
Cc: psodagud@codeaurora.org
Cc: gregkh@linuxfoundation.org
Cc: pkondeti@codeaurora.org
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20180730112140.GH2494@hirez.programming.kicks-ass.net
kernel/stop_machine.c