Messages in this thread Patch in this message | | | From | Daniel Wagner <> | Subject | [RFC v0 4/9] smpboot: Use freeze_active() instead CPU_DEAD_FROZEN state information | Date | Fri, 4 Sep 2015 15:34:57 +0200 |
| |
In order to get rid of all CPU_*_FROZEN states we need to convert all users first.
cpu_check_up_prepare() wants to report different errors depending on an ongoing suspend or not. freeze_active() reports back if that is the case so we don't have to rely on the CPU_DEAD_FROZEN anymore.
Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Chris Metcalf <cmetcalf@ezchip.com> Cc: Don Zickus <dzickus@redhat.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Lai Jiangshan <laijs@cn.fujitsu.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> Cc: linux-kernel@vger.kernel.org --- kernel/smpboot.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/kernel/smpboot.c b/kernel/smpboot.c index e37efbf..49ce4e9 100644 --- a/kernel/smpboot.c +++ b/kernel/smpboot.c @@ -13,6 +13,7 @@ #include <linux/percpu.h> #include <linux/kthread.h> #include <linux/smpboot.h> +#include <linux/suspend.h> #include "smpboot.h" @@ -407,26 +408,25 @@ int cpu_check_up_prepare(int cpu) switch (atomic_read(&per_cpu(cpu_hotplug_state, cpu))) { case CPU_POST_DEAD: + if (freeze_active()) { + /* + * Timeout during CPU death, so let caller know. + * The outgoing CPU completed its processing, but after + * cpu_wait_death() timed out and reported the error. The + * caller is free to proceed, in which case the state + * will be reset properly by cpu_set_state_online(). + * Proceeding despite this -EBUSY return makes sense + * for systems where the outgoing CPUs take themselves + * offline, with no post-death manipulation required from + * a surviving CPU. + */ + return -EBUSY; + } /* The CPU died properly, so just start it up again. */ atomic_set(&per_cpu(cpu_hotplug_state, cpu), CPU_UP_PREPARE); return 0; - case CPU_DEAD_FROZEN: - - /* - * Timeout during CPU death, so let caller know. - * The outgoing CPU completed its processing, but after - * cpu_wait_death() timed out and reported the error. The - * caller is free to proceed, in which case the state - * will be reset properly by cpu_set_state_online(). - * Proceeding despite this -EBUSY return makes sense - * for systems where the outgoing CPUs take themselves - * offline, with no post-death manipulation required from - * a surviving CPU. - */ - return -EBUSY; - case CPU_BROKEN: /* -- 2.4.3
| |