Skip to content

Commit

Permalink
cpumask: convert lib/smp_processor_id to new cpumask ops
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
rustyrussell authored and Ingo Molnar committed Jan 30, 2009
1 parent 3a9f84d commit 4ab0a94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/smp_processor_id.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ notrace unsigned int debug_smp_processor_id(void)
* Kernel threads bound to a single CPU can safely use
* smp_processor_id():
*/
if (cpus_equal(current->cpus_allowed, cpumask_of_cpu(this_cpu)))
if (cpumask_equal(&current->cpus_allowed, cpumask_of(this_cpu)))
goto out;

/*
Expand Down

0 comments on commit 4ab0a94

Please sign in to comment.