From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752719AbdJ0MLD (ORCPT ); Fri, 27 Oct 2017 08:11:03 -0400 Received: from terminus.zytor.com ([65.50.211.136]:37269 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752589AbdJ0MKv (ORCPT ); Fri, 27 Oct 2017 08:10:51 -0400 Date: Fri, 27 Oct 2017 05:05:59 -0700 From: tip-bot for Frederic Weisbecker Message-ID: Cc: mingo@kernel.org, lcapitulino@redhat.com, kernellwp@gmail.com, frederic@kernel.org, peterz@infradead.org, tglx@linutronix.de, cl@linux.com, torvalds@linux-foundation.org, cmetcalf@mellanox.com, paulmck@linux.vnet.ibm.com, efault@gmx.de, linux-kernel@vger.kernel.org, hpa@zytor.com, riel@redhat.com Reply-To: mingo@kernel.org, lcapitulino@redhat.com, frederic@kernel.org, kernellwp@gmail.com, peterz@infradead.org, cl@linux.com, tglx@linutronix.de, cmetcalf@mellanox.com, torvalds@linux-foundation.org, efault@gmx.de, paulmck@linux.vnet.ibm.com, linux-kernel@vger.kernel.org, hpa@zytor.com, riel@redhat.com In-Reply-To: <1509072159-31808-12-git-send-email-frederic@kernel.org> References: <1509072159-31808-12-git-send-email-frederic@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] sched/isolation: Add basic isolcpus flags Git-Commit-ID: 150dfee95feb913876ced5cc559a342384e8ea97 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: 150dfee95feb913876ced5cc559a342384e8ea97 Gitweb: https://git.kernel.org/tip/150dfee95feb913876ced5cc559a342384e8ea97 Author: Frederic Weisbecker AuthorDate: Fri, 27 Oct 2017 04:42:38 +0200 Committer: Ingo Molnar CommitDate: Fri, 27 Oct 2017 09:55:31 +0200 sched/isolation: Add basic isolcpus flags Add flags to control NOHZ and domain isolation from "isolcpus=", in order to centralize the isolation features to a common interface. Domain isolation remains the default so not to break the existing isolcpus boot paramater behaviour. Further flags in the future may include 0hz (1hz tick offload) and timers, workqueue, RCU, kthread, watchdog, likely all merged together in a common flag ("async"?). In any case, this will have to be modifiable by cpusets. Signed-off-by: Frederic Weisbecker Acked-by: Thomas Gleixner Cc: Chris Metcalf Cc: Christoph Lameter Cc: Linus Torvalds Cc: Luiz Capitulino Cc: Mike Galbraith Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Rik van Riel Cc: Wanpeng Li Link: http://lkml.kernel.org/r/1509072159-31808-12-git-send-email-frederic@kernel.org Signed-off-by: Ingo Molnar --- kernel/sched/isolation.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c index 8f666bc..b71b436 100644 --- a/kernel/sched/isolation.c +++ b/kernel/sched/isolation.c @@ -11,6 +11,7 @@ #include #include #include +#include DEFINE_STATIC_KEY_FALSE(housekeeping_overriden); EXPORT_SYMBOL_GPL(housekeeping_overriden); @@ -126,6 +127,29 @@ __setup("nohz_full=", housekeeping_nohz_full_setup); static int __init housekeeping_isolcpus_setup(char *str) { - return housekeeping_setup(str, HK_FLAG_DOMAIN); + unsigned int flags = 0; + + while (isalpha(*str)) { + if (!strncmp(str, "nohz,", 5)) { + str += 5; + flags |= HK_FLAG_TICK; + continue; + } + + if (!strncmp(str, "domain,", 7)) { + str += 7; + flags |= HK_FLAG_DOMAIN; + continue; + } + + pr_warn("isolcpus: Error, unknown flag\n"); + return 0; + } + + /* Default behaviour for isolcpus without flags */ + if (!flags) + flags |= HK_FLAG_DOMAIN; + + return housekeeping_setup(str, flags); } __setup("isolcpus=", housekeeping_isolcpus_setup);