diff options
Diffstat (limited to 'kernel/smp.c')
| -rw-r--r-- | kernel/smp.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/kernel/smp.c b/kernel/smp.c index aff8aa14f547..9e0d0b289118 100644 --- a/kernel/smp.c +++ b/kernel/smp.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include <linux/gfp.h> | 13 | #include <linux/gfp.h> |
| 14 | #include <linux/smp.h> | 14 | #include <linux/smp.h> |
| 15 | #include <linux/cpu.h> | 15 | #include <linux/cpu.h> |
| 16 | #include <linux/sched.h> | ||
| 16 | 17 | ||
| 17 | #include "smpboot.h" | 18 | #include "smpboot.h" |
| 18 | 19 | ||
| @@ -699,3 +700,24 @@ void kick_all_cpus_sync(void) | |||
| 699 | smp_call_function(do_nothing, NULL, 1); | 700 | smp_call_function(do_nothing, NULL, 1); |
| 700 | } | 701 | } |
| 701 | EXPORT_SYMBOL_GPL(kick_all_cpus_sync); | 702 | EXPORT_SYMBOL_GPL(kick_all_cpus_sync); |
| 703 | |||
| 704 | /** | ||
| 705 | * wake_up_all_idle_cpus - break all cpus out of idle | ||
| 706 | * wake_up_all_idle_cpus try to break all cpus which is in idle state even | ||
| 707 | * including idle polling cpus, for non-idle cpus, we will do nothing | ||
| 708 | * for them. | ||
| 709 | */ | ||
| 710 | void wake_up_all_idle_cpus(void) | ||
| 711 | { | ||
| 712 | int cpu; | ||
| 713 | |||
| 714 | preempt_disable(); | ||
| 715 | for_each_online_cpu(cpu) { | ||
| 716 | if (cpu == smp_processor_id()) | ||
| 717 | continue; | ||
| 718 | |||
| 719 | wake_up_if_idle(cpu); | ||
| 720 | } | ||
| 721 | preempt_enable(); | ||
| 722 | } | ||
| 723 | EXPORT_SYMBOL_GPL(wake_up_all_idle_cpus); | ||
