diff options
author | Prarit Bhargava <prarit@redhat.com> | 2016-02-04 09:38:00 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-02-05 08:46:38 +0100 |
commit | a6e4491c682a7b28574a62e6f311a0acec50b318 (patch) | |
tree | 79ea7ec2a7d06bbd4d4900eaeb9f8e4852c21936 | |
parent | b37a05c083c85c2657dca9bbe1f5d79dccf756d5 (diff) | |
download | linux-stable-a6e4491c682a7b28574a62e6f311a0acec50b318.tar.gz linux-stable-a6e4491c682a7b28574a62e6f311a0acec50b318.tar.bz2 linux-stable-a6e4491c682a7b28574a62e6f311a0acec50b318.zip |
sched/isolcpus: Output warning when the 'isolcpus=' kernel parameter is invalid
The isolcpus= kernel boot parameter restricts userspace from scheduling on
the specified CPUs.
If a CPU is specified that is outside the range of 0 to nr_cpu_ids,
cpulist_parse() will return -ERANGE, return an empty cpulist, and
fail silently.
This patch adds an error message to isolated_cpu_setup() to indicate to
the user that something has gone awry, and returns 0 on error.
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1454596680-10367-1-git-send-email-prarit@redhat.com
[ Twiddled some details. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | kernel/sched/core.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 9503d590e5ef..24fcdbf28b18 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6173,11 +6173,16 @@ cpu_attach_domain(struct sched_domain *sd, struct root_domain *rd, int cpu) /* Setup the mask of cpus configured for isolated domains */ static int __init isolated_cpu_setup(char *str) { + int ret; + alloc_bootmem_cpumask_var(&cpu_isolated_map); - cpulist_parse(str, cpu_isolated_map); + ret = cpulist_parse(str, cpu_isolated_map); + if (ret) { + pr_err("sched: Error, all isolcpus= values must be between 0 and %d\n", nr_cpu_ids); + return 0; + } return 1; } - __setup("isolcpus=", isolated_cpu_setup); struct s_data { |