From: Daniel Wagner <daniel.wagner@bmw-carit.de>
To: linux-kernel@vger.kernel.org
Cc: Daniel Wagner <daniel.wagner@bmw-carit.de>,
Andrew Morton <akpm@linux-foundation.org>,
Chris Metcalf <cmetcalf@ezchip.com>,
Don Zickus <dzickus@redhat.com>, Ingo Molnar <mingo@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Lai Jiangshan <laijs@cn.fujitsu.com>,
Peter Zijlstra <peterz@infradead.org>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Subject: [RFC v0 4/9] smpboot: Use freeze_active() instead CPU_DEAD_FROZEN state information
Date: Fri, 4 Sep 2015 15:34:57 +0200 [thread overview]
Message-ID: <1441373702-31796-5-git-send-email-daniel.wagner@bmw-carit.de> (raw)
In-Reply-To: <1441373702-31796-1-git-send-email-daniel.wagner@bmw-carit.de>
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
next prev parent reply other threads:[~2015-09-04 13:37 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-04 13:34 [RFC v0 0/9] Remove CPU_*_FROZEN Daniel Wagner
2015-09-04 13:34 ` [RFC v0 1/9] smpboot: Add a separate CPU state when a surviving CPU times out Daniel Wagner
2015-09-04 13:34 ` [RFC v0 2/9] suspend: Add getter function to report if freezing is active Daniel Wagner
2015-09-05 2:11 ` Rafael J. Wysocki
2015-09-07 8:55 ` Daniel Wagner
2015-09-07 13:42 ` Rafael J. Wysocki
2015-09-07 21:44 ` Rafael J. Wysocki
2015-09-08 8:19 ` Daniel Wagner
2015-09-04 13:34 ` [RFC v0 3/9] x86: Use freeze_active() instead of CPU_*_FROZEN Daniel Wagner
2015-09-04 13:34 ` Daniel Wagner [this message]
2015-09-08 8:49 ` [RFC v0 4/9] smpboot: Use freeze_active() instead CPU_DEAD_FROZEN state information Daniel Wagner
2015-09-04 13:34 ` [RFC v0 5/9] sched: Use freeze_active() instead CPU_*_FROZEN " Daniel Wagner
2015-09-04 13:34 ` [RFC v0 6/9] cpu: Restructure FROZEN state handling Daniel Wagner
2015-09-04 13:35 ` [RFC v0 7/9] cpu: Remove unused CPU_*_FROZEN states Daniel Wagner
2015-09-04 13:35 ` [RFC v0 8/9] cpu: Do not set CPU_TASKS_FROZEN anymore Daniel Wagner
2015-09-04 13:35 ` [RFC v0 9/9] doc: Update cpu-hotplug documents on removal of CPU_TASKS_FROZEN Daniel Wagner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1441373702-31796-5-git-send-email-daniel.wagner@bmw-carit.de \
--to=daniel.wagner@bmw-carit.de \
--cc=akpm@linux-foundation.org \
--cc=cmetcalf@ezchip.com \
--cc=dzickus@redhat.com \
--cc=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®