From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933697AbbIDNhb (ORCPT ); Fri, 4 Sep 2015 09:37:31 -0400 Received: from mail.bmw-carit.de ([62.245.222.98]:45809 "EHLO linuxmail.bmw-carit.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933524AbbIDNfN (ORCPT ); Fri, 4 Sep 2015 09:35:13 -0400 From: Daniel Wagner To: linux-kernel@vger.kernel.org Cc: Daniel Wagner , Andrew Morton , Chris Metcalf , Don Zickus , Ingo Molnar , Thomas Gleixner , Lai Jiangshan , Peter Zijlstra , "Paul E. McKenney" Subject: [RFC v0 4/9] smpboot: Use freeze_active() instead CPU_DEAD_FROZEN state information Date: Fri, 4 Sep 2015 15:34:57 +0200 Message-Id: <1441373702-31796-5-git-send-email-daniel.wagner@bmw-carit.de> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1441373702-31796-1-git-send-email-daniel.wagner@bmw-carit.de> References: <1441373702-31796-1-git-send-email-daniel.wagner@bmw-carit.de> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: Andrew Morton Cc: Chris Metcalf Cc: Don Zickus Cc: Ingo Molnar Cc: Thomas Gleixner Cc: Lai Jiangshan Cc: Peter Zijlstra Cc: "Paul E. McKenney" 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 #include #include +#include #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