|
@@ -13,6 +13,7 @@
|
|
|
#include <linux/gfp.h>
|
|
|
#include <linux/smp.h>
|
|
|
#include <linux/cpu.h>
|
|
|
+#include <linux/sched.h>
|
|
|
|
|
|
#include "smpboot.h"
|
|
|
|
|
@@ -699,3 +700,24 @@ void kick_all_cpus_sync(void)
|
|
|
smp_call_function(do_nothing, NULL, 1);
|
|
|
}
|
|
|
EXPORT_SYMBOL_GPL(kick_all_cpus_sync);
|
|
|
+
|
|
|
+/**
|
|
|
+ * wake_up_all_idle_cpus - break all cpus out of idle
|
|
|
+ * wake_up_all_idle_cpus try to break all cpus which is in idle state even
|
|
|
+ * including idle polling cpus, for non-idle cpus, we will do nothing
|
|
|
+ * for them.
|
|
|
+ */
|
|
|
+void wake_up_all_idle_cpus(void)
|
|
|
+{
|
|
|
+ int cpu;
|
|
|
+
|
|
|
+ preempt_disable();
|
|
|
+ for_each_online_cpu(cpu) {
|
|
|
+ if (cpu == smp_processor_id())
|
|
|
+ continue;
|
|
|
+
|
|
|
+ wake_up_if_idle(cpu);
|
|
|
+ }
|
|
|
+ preempt_enable();
|
|
|
+}
|
|
|
+EXPORT_SYMBOL_GPL(wake_up_all_idle_cpus);
|