History

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.

Frederic Weisbecker committed 9 years ago

Commit 150dfee1 parent edb93821 file · +25 −1Browse files

Unified · Split

kernel/sched/isolation.c+25−1
@@ -11,6 +11,7 @@ · 10 unmodified lines
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); · 109 unmodified lines
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);