|
@@ -669,9 +669,9 @@ EXPORT_SYMBOL(on_each_cpu_mask);
|
|
|
* You must not call this function with disabled interrupts or
|
|
|
* from a hardware interrupt handler or from a bottom half handler.
|
|
|
*/
|
|
|
-void on_each_cpu_cond(bool (*cond_func)(int cpu, void *info),
|
|
|
+void on_each_cpu_cond_mask(bool (*cond_func)(int cpu, void *info),
|
|
|
smp_call_func_t func, void *info, bool wait,
|
|
|
- gfp_t gfp_flags)
|
|
|
+ gfp_t gfp_flags, const struct cpumask *mask)
|
|
|
{
|
|
|
cpumask_var_t cpus;
|
|
|
int cpu, ret;
|
|
@@ -680,7 +680,7 @@ void on_each_cpu_cond(bool (*cond_func)(int cpu, void *info),
|
|
|
|
|
|
if (likely(zalloc_cpumask_var(&cpus, (gfp_flags|__GFP_NOWARN)))) {
|
|
|
preempt_disable();
|
|
|
- for_each_online_cpu(cpu)
|
|
|
+ for_each_cpu(cpu, mask)
|
|
|
if (cond_func(cpu, info))
|
|
|
__cpumask_set_cpu(cpu, cpus);
|
|
|
on_each_cpu_mask(cpus, func, info, wait);
|
|
@@ -692,7 +692,7 @@ void on_each_cpu_cond(bool (*cond_func)(int cpu, void *info),
|
|
|
* just have to IPI them one by one.
|
|
|
*/
|
|
|
preempt_disable();
|
|
|
- for_each_online_cpu(cpu)
|
|
|
+ for_each_cpu(cpu, mask)
|
|
|
if (cond_func(cpu, info)) {
|
|
|
ret = smp_call_function_single(cpu, func,
|
|
|
info, wait);
|
|
@@ -701,6 +701,15 @@ void on_each_cpu_cond(bool (*cond_func)(int cpu, void *info),
|
|
|
preempt_enable();
|
|
|
}
|
|
|
}
|
|
|
+EXPORT_SYMBOL(on_each_cpu_cond_mask);
|
|
|
+
|
|
|
+void on_each_cpu_cond(bool (*cond_func)(int cpu, void *info),
|
|
|
+ smp_call_func_t func, void *info, bool wait,
|
|
|
+ gfp_t gfp_flags)
|
|
|
+{
|
|
|
+ on_each_cpu_cond_mask(cond_func, func, info, wait, gfp_flags,
|
|
|
+ cpu_online_mask);
|
|
|
+}
|
|
|
EXPORT_SYMBOL(on_each_cpu_cond);
|
|
|
|
|
|
static void do_nothing(void *unused)
|