]> git.baikalelectronics.ru Git - kernel.git/commit
x86/smpboot: Initialize secondary CPU only if master CPU will wait for it
authorIgor Mammedov <imammedo@redhat.com>
Thu, 5 Jun 2014 13:42:45 +0000 (15:42 +0200)
committerIngo Molnar <mingo@kernel.org>
Thu, 5 Jun 2014 14:33:08 +0000 (16:33 +0200)
commit93a705e8d59c4959cf60fe5d00a60073cacfce4c
treed7d5de640f5d133af34f437b56c547005b437e4b
parent768ab71fef6b6ed6bd1569a8803f6e9c7d173925
x86/smpboot: Initialize secondary CPU only if master CPU will wait for it

Hang is observed on virtual machines during CPU hotplug,
especially in big guests with many CPUs. (It reproducible
more often if host is over-committed).

It happens because master CPU gives up waiting on
secondary CPU and allows it to run wild. As result
AP causes locking or crashing system. For example
as described here:

   https://lkml.org/lkml/2014/3/6/257

If master CPU have sent STARTUP IPI successfully,
and AP signalled to master CPU that it's ready
to start initialization, make master CPU wait
indefinitely till AP is onlined.
To ensure that AP won't ever run wild, make it
wait at early startup till master CPU confirms its
intention to wait for AP. If AP doesn't respond in 10
seconds, the master CPU will timeout and cancel
AP onlining.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Acked-by: Toshi Kani <toshi.kani@hp.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1401975765-22328-4-git-send-email-imammedo@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/cpu/common.c
arch/x86/kernel/smpboot.c