Skip to content

Commit 4ab0a94

Browse files
rustyrussellIngo Molnar
authored and
Ingo Molnar
committed
cpumask: convert lib/smp_processor_id to new cpumask ops
Impact: fix debug_smp_processor_id() for CONFIG_CPUMASK_OFFSTACK=y The scheduler now uses the new cpumask API, which deals up to nr_cpumask_bits, whereas the API used NR_CPUS bits. If CONFIG_CPUMASK_OFFSTACK=y these two are not equal, so the top bits are undefined. Leading to bug 12518 "BUG: using smp_processor_id() in preemptible [00000000] code: dellWirelessCtl/..." The fix is simple: use the modern API in the check. Signed-off-by: Rusty Russell <[email protected]> Signed-off-by: Mike Travis <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
1 parent 3a9f84d commit 4ab0a94

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/smp_processor_id.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ notrace unsigned int debug_smp_processor_id(void)
2222
* Kernel threads bound to a single CPU can safely use
2323
* smp_processor_id():
2424
*/
25-
if (cpus_equal(current->cpus_allowed, cpumask_of_cpu(this_cpu)))
25+
if (cpumask_equal(&current->cpus_allowed, cpumask_of(this_cpu)))
2626
goto out;
2727

2828
/*

0 commit comments

Comments
 (0)