[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1739170545-25011-16-git-send-email-kazuhiro3.hayashi@toshiba.co.jp>
Date: Mon, 10 Feb 2025 15:55:43 +0900
From: Kazuhiro Hayashi <kazuhiro3.hayashi@...hiba.co.jp>
To: linux-kernel@...r.kernel.org, linux-rt-devel@...ts.linux.dev,
cip-dev@...ts.cip-project.org
Cc: bigeasy@...utronix.de, tglx@...utronix.de, rostedt@...dmis.org,
linux-rt-users@...r.kernel.org, pavel@...x.de
Subject: [PATCH 4.4 v1 15/17] init: Introduce SYSTEM_SCHEDULING state
From: Thomas Gleixner <tglx@...utronix.de>
commit 69a78ff226fe0241ab6cb9dd961667be477e3cf7 upstream.
might_sleep() debugging and smp_processor_id() debugging should be active
right after the scheduler starts working. The init task can invoke
smp_processor_id() from preemptible context as it is pinned on the boot cpu
until sched_smp_init() removes the pinning and lets it schedule on all non
isolated cpus.
Add a new state which allows to enable those checks earlier and add it to
the xen do_poweroff() function.
No functional change.
Tested-by: Mark Rutland <mark.rutland@....com>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@...cle.com>
Acked-by: Mark Rutland <mark.rutland@....com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Juergen Gross <jgross@...e.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Steven Rostedt <rostedt@...dmis.org>
Link: http://lkml.kernel.org/r/20170516184736.196214622@linutronix.de
Signed-off-by: Ingo Molnar <mingo@...nel.org>
Signed-off-by: Kazuhiro Hayashi <kazuhiro3.hayashi@...hiba.co.jp>
---
drivers/xen/manage.c | 1 +
include/linux/kernel.h | 6 +++++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
index f494126aaecd..4f907fbda6c0 100644
--- a/drivers/xen/manage.c
+++ b/drivers/xen/manage.c
@@ -188,6 +188,7 @@ static void do_poweroff(void)
{
switch (system_state) {
case SYSTEM_BOOTING:
+ case SYSTEM_SCHEDULING:
orderly_poweroff(true);
break;
case SYSTEM_RUNNING:
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index d68f639f7330..d472456c6fcc 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -481,9 +481,13 @@ extern int root_mountflags;
extern bool early_boot_irqs_disabled;
-/* Values used for system_state */
+/*
+ * Values used for system_state. Ordering of the states must not be changed
+ * as code checks for <, <=, >, >= STATE.
+ */
extern enum system_states {
SYSTEM_BOOTING,
+ SYSTEM_SCHEDULING,
SYSTEM_RUNNING,
SYSTEM_HALT,
SYSTEM_POWER_OFF,
--
2.30.2
Powered by blists - more mailing lists