aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Weisbecker <frederic@kernel.org>2017-10-26 22:42:38 -0400
committerIngo Molnar <mingo@kernel.org>2017-10-27 03:55:31 -0400
commit150dfee95feb913876ced5cc559a342384e8ea97 (patch)
treecdeb75a372c2190e65106d0ef6606df2cb9d5dbd
parentedb9382175c3ebdced8ffdb3e0f20052ad9fdbe9 (diff)
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 <frederic@kernel.org> Acked-by: Thomas Gleixner <tglx@linutronix.de> Cc: Chris Metcalf <cmetcalf@mellanox.com> Cc: Christoph Lameter <cl@linux.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Luiz Capitulino <lcapitulino@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Rik van Riel <riel@redhat.com> Cc: Wanpeng Li <kernellwp@gmail.com> Link: http://lkml.kernel.org/r/1509072159-31808-12-git-send-email-frederic@kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--kernel/sched/isolation.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c
index 8f666bc5abe8..b71b436f59f2 100644
--- a/kernel/sched/isolation.c
+++ b/kernel/sched/isolation.c
@@ -11,6 +11,7 @@
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/static_key.h> 13#include <linux/static_key.h>
14#include <linux/ctype.h>
14 15
15DEFINE_STATIC_KEY_FALSE(housekeeping_overriden); 16DEFINE_STATIC_KEY_FALSE(housekeeping_overriden);
16EXPORT_SYMBOL_GPL(housekeeping_overriden); 17EXPORT_SYMBOL_GPL(housekeeping_overriden);
@@ -126,6 +127,29 @@ __setup("nohz_full=", housekeeping_nohz_full_setup);
126 127
127static int __init housekeeping_isolcpus_setup(char *str) 128static int __init housekeeping_isolcpus_setup(char *str)
128{ 129{
129 return housekeeping_setup(str, HK_FLAG_DOMAIN); 130 unsigned int flags = 0;
131
132 while (isalpha(*str)) {
133 if (!strncmp(str, "nohz,", 5)) {
134 str += 5;
135 flags |= HK_FLAG_TICK;
136 continue;
137 }
138
139 if (!strncmp(str, "domain,", 7)) {
140 str += 7;
141 flags |= HK_FLAG_DOMAIN;
142 continue;
143 }
144
145 pr_warn("isolcpus: Error, unknown flag\n");
146 return 0;
147 }
148
149 /* Default behaviour for isolcpus without flags */
150 if (!flags)
151 flags |= HK_FLAG_DOMAIN;
152
153 return housekeeping_setup(str, flags);
130} 154}
131__setup("isolcpus=", housekeeping_isolcpus_setup); 155__setup("isolcpus=", housekeeping_isolcpus_setup);