]> git.baikalelectronics.ru Git - kernel.git/commit
cpu: Defer smpboot kthread unparking until CPU known to scheduler
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Sun, 12 Apr 2015 15:06:55 +0000 (08:06 -0700)
committerIngo Molnar <mingo@kernel.org>
Mon, 13 Apr 2015 06:25:16 +0000 (08:25 +0200)
commit4bc00f77b2d2cc378880cf940bebf3fd9f356f8d
tree626f0f8fd29b55f9a203565948dfd8bb70530496
parent6b67c038b94ded7a65f940b3837b98988f942833
cpu: Defer smpboot kthread unparking until CPU known to scheduler

Currently, smpboot_unpark_threads() is invoked before the incoming CPU
has been added to the scheduler's runqueue structures.  This might
potentially cause the unparked kthread to run on the wrong CPU, since the
correct CPU isn't fully set up yet.

That causes a sporadic, hard to debug boot crash triggering on some
systems, reported by Borislav Petkov, and bisected down to:

  79f101041d77 ("x86: Use common outgoing-CPU-notification code")

This patch places smpboot_unpark_threads() in a CPU hotplug
notifier with priority set so that these kthreads are unparked just after
the CPU has been added to the runqueues.

Reported-and-tested-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
include/linux/cpu.h
init/main.c
kernel/cpu.c