diff options
author | Amerigo Wang <amwang@redhat.com> | 2011-01-12 19:59:39 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 11:03:08 -0500 |
commit | 351f8f8e6499ae4fff40f5e3a8fe16d9e1903646 (patch) | |
tree | 9393c8d3a6a1eaa9dba50932eb6de3017a8afe86 /kernel | |
parent | b8cb464e4a8abc60ad5a43e0375fec8a3c728167 (diff) |
kernel: clean up USE_GENERIC_SMP_HELPERS
For arch which needs USE_GENERIC_SMP_HELPERS, it has to select
USE_GENERIC_SMP_HELPERS, rather than leaving a choice to user, since they
don't provide their own implementions.
Also, move on_each_cpu() to kernel/smp.c, it is strange to put it in
kernel/softirq.c.
For arch which doesn't use USE_GENERIC_SMP_HELPERS, e.g. blackfin, only
on_each_cpu() is compiled.
Signed-off-by: Amerigo Wang <amwang@redhat.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/Makefile | 2 | ||||
-rw-r--r-- | kernel/smp.c | 19 | ||||
-rw-r--r-- | kernel/softirq.c | 19 |
3 files changed, 20 insertions, 20 deletions
diff --git a/kernel/Makefile b/kernel/Makefile index 5669f71dfdd5..353d3fe8ba33 100644 --- a/kernel/Makefile +++ b/kernel/Makefile | |||
@@ -43,7 +43,7 @@ obj-$(CONFIG_RT_MUTEXES) += rtmutex.o | |||
43 | obj-$(CONFIG_DEBUG_RT_MUTEXES) += rtmutex-debug.o | 43 | obj-$(CONFIG_DEBUG_RT_MUTEXES) += rtmutex-debug.o |
44 | obj-$(CONFIG_RT_MUTEX_TESTER) += rtmutex-tester.o | 44 | obj-$(CONFIG_RT_MUTEX_TESTER) += rtmutex-tester.o |
45 | obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o | 45 | obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o |
46 | obj-$(CONFIG_USE_GENERIC_SMP_HELPERS) += smp.o | 46 | obj-$(CONFIG_SMP) += smp.o |
47 | ifneq ($(CONFIG_SMP),y) | 47 | ifneq ($(CONFIG_SMP),y) |
48 | obj-y += up.o | 48 | obj-y += up.o |
49 | endif | 49 | endif |
diff --git a/kernel/smp.c b/kernel/smp.c index 12ed8b013e2d..4ec30e069987 100644 --- a/kernel/smp.c +++ b/kernel/smp.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/smp.h> | 13 | #include <linux/smp.h> |
14 | #include <linux/cpu.h> | 14 | #include <linux/cpu.h> |
15 | 15 | ||
16 | #ifdef CONFIG_USE_GENERIC_SMP_HELPERS | ||
16 | static struct { | 17 | static struct { |
17 | struct list_head queue; | 18 | struct list_head queue; |
18 | raw_spinlock_t lock; | 19 | raw_spinlock_t lock; |
@@ -529,3 +530,21 @@ void ipi_call_unlock_irq(void) | |||
529 | { | 530 | { |
530 | raw_spin_unlock_irq(&call_function.lock); | 531 | raw_spin_unlock_irq(&call_function.lock); |
531 | } | 532 | } |
533 | #endif /* USE_GENERIC_SMP_HELPERS */ | ||
534 | |||
535 | /* | ||
536 | * Call a function on all processors | ||
537 | */ | ||
538 | int on_each_cpu(void (*func) (void *info), void *info, int wait) | ||
539 | { | ||
540 | int ret = 0; | ||
541 | |||
542 | preempt_disable(); | ||
543 | ret = smp_call_function(func, info, wait); | ||
544 | local_irq_disable(); | ||
545 | func(info); | ||
546 | local_irq_enable(); | ||
547 | preempt_enable(); | ||
548 | return ret; | ||
549 | } | ||
550 | EXPORT_SYMBOL(on_each_cpu); | ||
diff --git a/kernel/softirq.c b/kernel/softirq.c index 0823778f87fc..68eb5efec388 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c | |||
@@ -885,25 +885,6 @@ static __init int spawn_ksoftirqd(void) | |||
885 | } | 885 | } |
886 | early_initcall(spawn_ksoftirqd); | 886 | early_initcall(spawn_ksoftirqd); |
887 | 887 | ||
888 | #ifdef CONFIG_SMP | ||
889 | /* | ||
890 | * Call a function on all processors | ||
891 | */ | ||
892 | int on_each_cpu(void (*func) (void *info), void *info, int wait) | ||
893 | { | ||
894 | int ret = 0; | ||
895 | |||
896 | preempt_disable(); | ||
897 | ret = smp_call_function(func, info, wait); | ||
898 | local_irq_disable(); | ||
899 | func(info); | ||
900 | local_irq_enable(); | ||
901 | preempt_enable(); | ||
902 | return ret; | ||
903 | } | ||
904 | EXPORT_SYMBOL(on_each_cpu); | ||
905 | #endif | ||
906 | |||
907 | /* | 888 | /* |
908 | * [ These __weak aliases are kept in a separate compilation unit, so that | 889 | * [ These __weak aliases are kept in a separate compilation unit, so that |
909 | * GCC does not inline them incorrectly. ] | 890 | * GCC does not inline them incorrectly. ] |