From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Wei Liu <wei.liu2@citrix.com>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
George Dunlap <George.Dunlap@eu.citrix.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>,
Julien Grall <julien.grall@arm.com>,
Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v2 3/6] xen: add new cpu notifier action CPU_RESUME_FAILED
Date: Thu, 28 Mar 2019 13:06:55 +0100 [thread overview]
Message-ID: <20190328120658.11083-4-jgross@suse.com> (raw)
In-Reply-To: <20190328120658.11083-1-jgross@suse.com>
Add a new cpu notifier action CPU_RESUME_FAILED which is called for all
cpus which failed to come up at resume. The calls will be done after
all other cpus are already up in order to know which resources are
available then.
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Dario Faggioli <dfaggioli@suse.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
---
V2:
- added comment in xen/include/xen/cpu.h (Dario Faggioli)
---
xen/common/cpu.c | 5 +++++
xen/include/xen/cpu.h | 29 ++++++++++++++++++-----------
2 files changed, 23 insertions(+), 11 deletions(-)
diff --git a/xen/common/cpu.c b/xen/common/cpu.c
index 8bf69600a6..a6efc5e604 100644
--- a/xen/common/cpu.c
+++ b/xen/common/cpu.c
@@ -218,7 +218,12 @@ void enable_nonboot_cpus(void)
printk("Error bringing CPU%d up: %d\n", cpu, error);
BUG_ON(error == -EBUSY);
}
+ else
+ __cpumask_clear_cpu(cpu, &frozen_cpus);
}
+ for_each_cpu ( cpu, &frozen_cpus )
+ cpu_notifier_call_chain(cpu, CPU_RESUME_FAILED, NULL, true);
+
cpumask_clear(&frozen_cpus);
}
diff --git a/xen/include/xen/cpu.h b/xen/include/xen/cpu.h
index 2fe3ec05d8..4638c509e2 100644
--- a/xen/include/xen/cpu.h
+++ b/xen/include/xen/cpu.h
@@ -22,33 +22,40 @@ void register_cpu_notifier(struct notifier_block *nb);
* CPU_UP_PREPARE -> CPU_STARTING -> CPU_ONLINE -- successful CPU up
* CPU_DOWN_PREPARE -> CPU_DOWN_FAILED -- failed CPU down
* CPU_DOWN_PREPARE -> CPU_DYING -> CPU_DEAD -- successful CPU down
- *
+ * in the resume case we have additionally:
+ * CPU_UP_PREPARE -> CPU_UP_CANCELLED -> CPU_RESUME_FAILED -- CPU not resumed
+ * with the CPU_RESUME_FAILED handler called only after all CPUs have been
+ * tried to put online again in order to know which CPUs did restart
+ * successfully.
+ *
* Hence note that only CPU_*_PREPARE handlers are allowed to fail. Also note
* that once CPU_DYING is delivered, an offline action can no longer fail.
- *
+ *
* Notifiers are called highest-priority-first when:
* (a) A CPU is coming up; or (b) CPU_DOWN_FAILED
* Notifiers are called lowest-priority-first when:
* (a) A CPU is going down; or (b) CPU_UP_CANCELED
*/
/* CPU_UP_PREPARE: Preparing to bring CPU online. */
-#define CPU_UP_PREPARE (0x0001 | NOTIFY_FORWARD)
+#define CPU_UP_PREPARE (0x0001 | NOTIFY_FORWARD)
/* CPU_UP_CANCELED: CPU is no longer being brought online. */
-#define CPU_UP_CANCELED (0x0002 | NOTIFY_REVERSE)
+#define CPU_UP_CANCELED (0x0002 | NOTIFY_REVERSE)
/* CPU_STARTING: CPU nearly online. Runs on new CPU, irqs still disabled. */
-#define CPU_STARTING (0x0003 | NOTIFY_FORWARD)
+#define CPU_STARTING (0x0003 | NOTIFY_FORWARD)
/* CPU_ONLINE: CPU is up. */
-#define CPU_ONLINE (0x0004 | NOTIFY_FORWARD)
+#define CPU_ONLINE (0x0004 | NOTIFY_FORWARD)
/* CPU_DOWN_PREPARE: CPU is going down. */
-#define CPU_DOWN_PREPARE (0x0005 | NOTIFY_REVERSE)
+#define CPU_DOWN_PREPARE (0x0005 | NOTIFY_REVERSE)
/* CPU_DOWN_FAILED: CPU is no longer going down. */
-#define CPU_DOWN_FAILED (0x0006 | NOTIFY_FORWARD)
+#define CPU_DOWN_FAILED (0x0006 | NOTIFY_FORWARD)
/* CPU_DYING: CPU is nearly dead (in stop_machine context). */
-#define CPU_DYING (0x0007 | NOTIFY_REVERSE)
+#define CPU_DYING (0x0007 | NOTIFY_REVERSE)
/* CPU_DEAD: CPU is dead. */
-#define CPU_DEAD (0x0008 | NOTIFY_REVERSE)
+#define CPU_DEAD (0x0008 | NOTIFY_REVERSE)
/* CPU_REMOVE: CPU was removed. */
-#define CPU_REMOVE (0x0009 | NOTIFY_REVERSE)
+#define CPU_REMOVE (0x0009 | NOTIFY_REVERSE)
+/* CPU_RESUME_FAILED: CPU failed to come up in resume, all other CPUs up. */
+#define CPU_RESUME_FAILED (0x000a | NOTIFY_REVERSE)
/* Perform CPU hotplug. May return -EAGAIN. */
int cpu_down(unsigned int cpu);
--
2.16.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2019-03-28 12:07 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-28 12:06 [PATCH v2 0/6] xen: simplify suspend/resume handling Juergen Gross
2019-03-28 12:06 ` [PATCH v2 1/6] xen/sched: call cpu_disable_scheduler() via cpu notifier Juergen Gross
2019-03-29 17:19 ` Dario Faggioli
2019-04-01 10:34 ` Julien Grall
2019-03-28 12:06 ` [PATCH v2 2/6] xen: add helper for calling notifier_call_chain() to common/cpu.c Juergen Gross
2019-03-29 17:33 ` Dario Faggioli
2019-03-28 12:06 ` Juergen Gross [this message]
2019-03-28 12:06 ` [PATCH v2 4/6] xen: don't free percpu areas during suspend Juergen Gross
2019-03-28 13:39 ` Jan Beulich
2019-03-28 12:06 ` [PATCH v2 5/6] xen/cpupool: simplify suspend/resume handling Juergen Gross
2019-03-28 12:06 ` [PATCH v2 6/6] xen/sched: don't disable scheduler on cpus during suspend Juergen Gross
2019-03-29 17:36 ` Dario Faggioli
2019-03-28 13:01 ` [PATCH v2 0/6] xen: simplify suspend/resume handling Volodymyr Babchuk
2019-03-28 13:21 ` Juergen Gross
2019-03-28 13:23 ` Julien Grall
2019-03-28 13:34 ` Volodymyr Babchuk
2019-03-28 13:33 ` Julien Grall
2019-03-28 13:37 ` Juergen Gross
2019-03-28 13:49 ` Julien Grall
2019-03-28 13:56 ` Volodymyr Babchuk
2019-03-28 14:43 ` Julien Grall
2019-03-28 14:53 ` Dario Faggioli
2019-03-28 14:57 ` Volodymyr Babchuk
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=20190328120658.11083-4-jgross@suse.com \
--to=jgross@suse.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=julien.grall@arm.com \
--cc=konrad.wilk@oracle.com \
--cc=sstabellini@kernel.org \
--cc=tim@xen.org \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.