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
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); · 109 unmodified lines
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);