Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Jan Beulich <jbeulich@novell.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Jan Beulich and committed by
Greg Kroah-Hartman
cdc6e3d3 d7dbf4ff

+1 -1
+1 -1
drivers/base/cpu.c
··· 186 186 /* display offline cpus < nr_cpu_ids */ 187 187 if (!alloc_cpumask_var(&offline, GFP_KERNEL)) 188 188 return -ENOMEM; 189 - cpumask_complement(offline, cpu_online_mask); 189 + cpumask_andnot(offline, cpu_possible_mask, cpu_online_mask); 190 190 n = cpulist_scnprintf(buf, len, offline); 191 191 free_cpumask_var(offline); 192 192