From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760225AbdEWJBB (ORCPT ); Tue, 23 May 2017 05:01:01 -0400 Received: from terminus.zytor.com ([65.50.211.136]:51629 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758705AbdEWJA5 (ORCPT ); Tue, 23 May 2017 05:00:57 -0400 Date: Tue, 23 May 2017 01:56:14 -0700 From: tip-bot for Thomas Gleixner Message-ID: Cc: tglx@linutronix.de, mingo@kernel.org, jgross@suse.com, peterz@infradead.org, mark.rutland@arm.com, hpa@zytor.com, boris.ostrovsky@oracle.com, torvalds@linux-foundation.org, rostedt@goodmis.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Reply-To: peterz@infradead.org, hpa@zytor.com, mark.rutland@arm.com, tglx@linutronix.de, jgross@suse.com, mingo@kernel.org, rostedt@goodmis.org, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, boris.ostrovsky@oracle.com In-Reply-To: <20170516184736.196214622@linutronix.de> References: <20170516184736.196214622@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] init: Introduce SYSTEM_SCHEDULING state Git-Commit-ID: 69a78ff226fe0241ab6cb9dd961667be477e3cf7 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 69a78ff226fe0241ab6cb9dd961667be477e3cf7 Gitweb: http://git.kernel.org/tip/69a78ff226fe0241ab6cb9dd961667be477e3cf7 Author: Thomas Gleixner AuthorDate: Tue, 16 May 2017 20:42:47 +0200 Committer: Ingo Molnar 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 Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Boris Ostrovsky Acked-by: Mark Rutland Cc: Greg Kroah-Hartman Cc: Juergen Gross Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Steven Rostedt Link: http://lkml.kernel.org/r/20170516184736.196214622@linutronix.de Signed-off-by: Ingo Molnar --- 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,