Skip to content

Commit 69a78ff

Browse files
KAGA-KOKOIngo Molnar
authored andcommitted
init: Introduce SYSTEM_SCHEDULING state
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 <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Boris Ostrovsky <[email protected]> Acked-by: Mark Rutland <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Juergen Gross <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Steven Rostedt <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent c6202ad commit 69a78ff

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

drivers/xen/manage.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ static void do_poweroff(void)
190190
{
191191
switch (system_state) {
192192
case SYSTEM_BOOTING:
193+
case SYSTEM_SCHEDULING:
193194
orderly_poweroff(true);
194195
break;
195196
case SYSTEM_RUNNING:

include/linux/kernel.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,9 +490,13 @@ extern int root_mountflags;
490490

491491
extern bool early_boot_irqs_disabled;
492492

493-
/* Values used for system_state */
493+
/*
494+
* Values used for system_state. Ordering of the states must not be changed
495+
* as code checks for <, <=, >, >= STATE.
496+
*/
494497
extern enum system_states {
495498
SYSTEM_BOOTING,
499+
SYSTEM_SCHEDULING,
496500
SYSTEM_RUNNING,
497501
SYSTEM_HALT,
498502
SYSTEM_POWER_OFF,

0 commit comments

Comments
 (0)