Skip to content

Commit 150dfee

Browse files
Frederic WeisbeckerIngo Molnar
authored andcommitted
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 <[email protected]> Acked-by: Thomas Gleixner <[email protected]> Cc: Chris Metcalf <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Luiz Capitulino <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Paul E. McKenney <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Rik van Riel <[email protected]> Cc: Wanpeng Li <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent edb9382 commit 150dfee

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

kernel/sched/isolation.c

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/init.h>
1212
#include <linux/kernel.h>
1313
#include <linux/static_key.h>
14+
#include <linux/ctype.h>
1415

1516
DEFINE_STATIC_KEY_FALSE(housekeeping_overriden);
1617
EXPORT_SYMBOL_GPL(housekeeping_overriden);
@@ -126,6 +127,29 @@ __setup("nohz_full=", housekeeping_nohz_full_setup);
126127

127128
static int __init housekeeping_isolcpus_setup(char *str)
128129
{
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);
130154
}
131155
__setup("isolcpus=", housekeeping_isolcpus_setup);

0 commit comments

Comments
 (0)