Commit cdc6e3d3 authored by Jan Beulich's avatar Jan Beulich Committed by Greg Kroah-Hartman

drivers/base/cpu.c: fix the output from /sys/devices/system/cpu/offline

Without CONFIG_CPUMASK_OFFSTACK, simply inverting cpu_online_mask leads
to CPUs beyond nr_cpu_ids to be displayed twice and CPUs not even
possible to be displayed as offline.
Signed-off-by: default avatarJan Beulich <jbeulich@novell.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Cc: stable <stable@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent d7dbf4ff
...@@ -186,7 +186,7 @@ static ssize_t print_cpus_offline(struct sysdev_class *class, ...@@ -186,7 +186,7 @@ static ssize_t print_cpus_offline(struct sysdev_class *class,
/* display offline cpus < nr_cpu_ids */ /* display offline cpus < nr_cpu_ids */
if (!alloc_cpumask_var(&offline, GFP_KERNEL)) if (!alloc_cpumask_var(&offline, GFP_KERNEL))
return -ENOMEM; return -ENOMEM;
cpumask_complement(offline, cpu_online_mask); cpumask_andnot(offline, cpu_possible_mask, cpu_online_mask);
n = cpulist_scnprintf(buf, len, offline); n = cpulist_scnprintf(buf, len, offline);
free_cpumask_var(offline); free_cpumask_var(offline);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment