[PATCH] include/linux/smp.h: define __smp_call_function_single for!CONFIG_SMP

From: Michal Hocko
Date: Thu Aug 01 2013 - 03:50:28 EST

This function was not needed until (watchdog: update watchdog_tresh
properly) which cannot use on_each_cpu unfortunately as
watchdog_nmi_enable relies on perf_event_alloc which is might sleep.

Export it as an alias to on_each_cpu for !CONFIG_SMP.

Reported-by: Fengguang Wu <fengguang.wu@xxxxxxxxx>
Signed-off-by: Michal Hocko <mhocko@xxxxxxx>
include/linux/smp.h | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/include/linux/smp.h b/include/linux/smp.h
index c848876..3d12d72 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -151,6 +151,12 @@ static inline int on_each_cpu(smp_call_func_t func, void *info, int wait)
return 0;

+static inline void __smp_call_function_single(int cpuid,
+ struct call_single_data *data, int wait)
+ on_each_cpu(data->func, data->info, wait);
* Note we still need to test the mask even for UP
* because we actually can get an empty mask from

Michal Hocko
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/