Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / arch / x86 / kernel / smp.c
index cf1f075886b40a6773dc8f1ebe713839bc5ca1ee..e6faa3316bd2e04311313ce4c7c68ef3438ef274 100644 (file)
@@ -128,16 +128,23 @@ void native_send_call_func_single_ipi(int cpu)
 
 void native_send_call_func_ipi(const struct cpumask *mask)
 {
-       cpumask_t allbutself;
+       cpumask_var_t allbutself;
 
-       allbutself = cpu_online_map;
-       cpu_clear(smp_processor_id(), allbutself);
+       if (!alloc_cpumask_var(&allbutself, GFP_ATOMIC)) {
+               send_IPI_mask(mask, CALL_FUNCTION_VECTOR);
+               return;
+       }
 
-       if (cpus_equal(*mask, allbutself) &&
-           cpus_equal(cpu_online_map, cpu_callout_map))
+       cpumask_copy(allbutself, cpu_online_mask);
+       cpumask_clear_cpu(smp_processor_id(), allbutself);
+
+       if (cpumask_equal(mask, allbutself) &&
+           cpumask_equal(cpu_online_mask, cpu_callout_mask))
                send_IPI_allbutself(CALL_FUNCTION_VECTOR);
        else
                send_IPI_mask(mask, CALL_FUNCTION_VECTOR);
+
+       free_cpumask_var(allbutself);
 }
 
 /*