1
0
Fork 0

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 <rusty@rustcorp.com.au>
Signed-off-by: Mike Travis <travis@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
hifive-unleashed-5.1
Rusty Russell 2009-01-10 21:58:09 -08:00 committed by Ingo Molnar
parent 3a9f84d354
commit 4ab0a9409a
1 changed files with 1 additions and 1 deletions

View File

@ -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;
/*