Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1642750 > unrolled thread

[patch V2 16/17] init: Introduce SYSTEM_SCHEDULING state

Started byThomas Gleixner <tglx@linutronix.de>
First post2017-05-16 21:00 +0200
Last post2017-05-23 11:10 +0200
Articles 4 — 4 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [patch V2 16/17] init: Introduce SYSTEM_SCHEDULING state Thomas Gleixner <tglx@linutronix.de> - 2017-05-16 21:00 +0200
    Re: [patch V2 16/17] init: Introduce SYSTEM_SCHEDULING state Mark Rutland <mark.rutland@arm.com> - 2017-05-17 13:00 +0200
    Re: [patch V2 16/17] init: Introduce SYSTEM_SCHEDULING state Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2017-05-17 23:20 +0200
    [tip:sched/core] init: Introduce SYSTEM_SCHEDULING state tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2017-05-23 11:10 +0200

#1642750 — [patch V2 16/17] init: Introduce SYSTEM_SCHEDULING state

FromThomas Gleixner <tglx@linutronix.de>
Date2017-05-16 21:00 +0200
Subject[patch V2 16/17] init: Introduce SYSTEM_SCHEDULING state
Message-ID<tHPRo-M2-37@gated-at.bofh.it>
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.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---

V2: Use only one intermediate state and document that state order matters.

 drivers/xen/manage.c   |    1 +
 include/linux/kernel.h |    6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

--- a/drivers/xen/manage.c
+++ b/drivers/xen/manage.c
@@ -190,6 +190,7 @@ static void do_poweroff(void)
 {
 	switch (system_state) {
 	case SYSTEM_BOOTING:
+	case SYSTEM_SCHEDULING:
 		orderly_poweroff(true);
 		break;
 	case SYSTEM_RUNNING:
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -490,9 +490,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,

[toc] | [next] | [standalone]


#1643260

FromMark Rutland <mark.rutland@arm.com>
Date2017-05-17 13:00 +0200
Message-ID<tI4Qq-1Z2-7@gated-at.bofh.it>
In reply to#1642750
On Tue, May 16, 2017 at 08:42:47PM +0200, Thomas Gleixner wrote:
> 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.
> 
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Cc: Juergen Gross <jgross@suse.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Makes sense to me. FWIW:

Acked-by: Mark Rutland <mark.rutland@arm.com>

Mark.

> ---
> 
> V2: Use only one intermediate state and document that state order matters.
> 
>  drivers/xen/manage.c   |    1 +
>  include/linux/kernel.h |    6 +++++-
>  2 files changed, 6 insertions(+), 1 deletion(-)
> 
> --- a/drivers/xen/manage.c
> +++ b/drivers/xen/manage.c
> @@ -190,6 +190,7 @@ static void do_poweroff(void)
>  {
>  	switch (system_state) {
>  	case SYSTEM_BOOTING:
> +	case SYSTEM_SCHEDULING:
>  		orderly_poweroff(true);
>  		break;
>  	case SYSTEM_RUNNING:
> --- a/include/linux/kernel.h
> +++ b/include/linux/kernel.h
> @@ -490,9 +490,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,
> 
> 

[toc] | [prev] | [next] | [standalone]


#1643635

FromBoris Ostrovsky <boris.ostrovsky@oracle.com>
Date2017-05-17 23:20 +0200
Message-ID<tIewq-8p4-5@gated-at.bofh.it>
In reply to#1642750
On 05/16/2017 02:42 PM, Thomas Gleixner wrote:
> 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.
>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Cc: Juergen Gross <jgross@suse.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

[toc] | [prev] | [next] | [standalone]


#1647864 — [tip:sched/core] init: Introduce SYSTEM_SCHEDULING state

Fromtip-bot for Thomas Gleixner <tipbot@zytor.com>
Date2017-05-23 11:10 +0200
Subject[tip:sched/core] init: Introduce SYSTEM_SCHEDULING state
Message-ID<tKdZh-15V-41@gated-at.bofh.it>
In reply to#1642750
Commit-ID:  69a78ff226fe0241ab6cb9dd961667be477e3cf7
Gitweb:     http://git.kernel.org/tip/69a78ff226fe0241ab6cb9dd961667be477e3cf7
Author:     Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Tue, 16 May 2017 20:42:47 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 23 May 2017 10:01:38 +0200

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 <mark.rutland@arm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Juergen Gross <jgross@suse.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/20170516184736.196214622@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 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 c1ec8ee..9e35032 100644
--- a/drivers/xen/manage.c
+++ b/drivers/xen/manage.c
@@ -190,6 +190,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 13bc08a..1c91f26 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -490,9 +490,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,

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web