diff options
author | Matthew Wilcox <matthew@wil.cx> | 2008-03-07 21:55:58 -0500 |
---|---|---|
committer | Matthew Wilcox <willy@linux.intel.com> | 2008-04-17 10:42:34 -0400 |
commit | 64ac24e738823161693bf791f87adc802cf529ff (patch) | |
tree | 19c0b0cf314d4394ca580c05b86cdf874ce0a167 /arch/um | |
parent | e48b3deee475134585eed03e7afebe4bf9e0dba9 (diff) |
Generic semaphore implementation
Semaphores are no longer performance-critical, so a generic C
implementation is better for maintainability, debuggability and
extensibility. Thanks to Peter Zijlstra for fixing the lockdep
warning. Thanks to Harvey Harrison for pointing out that the
unlikely() was unnecessary.
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/um')
-rw-r--r-- | arch/um/Kconfig.i386 | 4 | ||||
-rw-r--r-- | arch/um/Kconfig.x86_64 | 4 | ||||
-rw-r--r-- | arch/um/sys-i386/ksyms.c | 12 | ||||
-rw-r--r-- | arch/um/sys-ppc/Makefile | 8 | ||||
-rw-r--r-- | arch/um/sys-x86_64/ksyms.c | 13 |
5 files changed, 3 insertions, 38 deletions
diff --git a/arch/um/Kconfig.i386 b/arch/um/Kconfig.i386 index 3cd8a04d66d8..e09edfa560da 100644 --- a/arch/um/Kconfig.i386 +++ b/arch/um/Kconfig.i386 | |||
@@ -19,10 +19,6 @@ config 64BIT | |||
19 | bool | 19 | bool |
20 | default n | 20 | default n |
21 | 21 | ||
22 | config SEMAPHORE_SLEEPERS | ||
23 | bool | ||
24 | default y | ||
25 | |||
26 | config 3_LEVEL_PGTABLES | 22 | config 3_LEVEL_PGTABLES |
27 | bool "Three-level pagetables (EXPERIMENTAL)" | 23 | bool "Three-level pagetables (EXPERIMENTAL)" |
28 | default n | 24 | default n |
diff --git a/arch/um/Kconfig.x86_64 b/arch/um/Kconfig.x86_64 index 6533b349f061..3fbe69e359ed 100644 --- a/arch/um/Kconfig.x86_64 +++ b/arch/um/Kconfig.x86_64 | |||
@@ -11,10 +11,6 @@ config RWSEM_GENERIC_SPINLOCK | |||
11 | bool | 11 | bool |
12 | default y | 12 | default y |
13 | 13 | ||
14 | config SEMAPHORE_SLEEPERS | ||
15 | bool | ||
16 | default y | ||
17 | |||
18 | config 3_LEVEL_PGTABLES | 14 | config 3_LEVEL_PGTABLES |
19 | bool | 15 | bool |
20 | default y | 16 | default y |
diff --git a/arch/um/sys-i386/ksyms.c b/arch/um/sys-i386/ksyms.c index 2a1eac1859ce..bfbefd30db8f 100644 --- a/arch/um/sys-i386/ksyms.c +++ b/arch/um/sys-i386/ksyms.c | |||
@@ -1,17 +1,5 @@ | |||
1 | #include "linux/module.h" | 1 | #include "linux/module.h" |
2 | #include "linux/in6.h" | ||
3 | #include "linux/rwsem.h" | ||
4 | #include "asm/byteorder.h" | ||
5 | #include "asm/delay.h" | ||
6 | #include "asm/semaphore.h" | ||
7 | #include "asm/uaccess.h" | ||
8 | #include "asm/checksum.h" | 2 | #include "asm/checksum.h" |
9 | #include "asm/errno.h" | ||
10 | |||
11 | EXPORT_SYMBOL(__down_failed); | ||
12 | EXPORT_SYMBOL(__down_failed_interruptible); | ||
13 | EXPORT_SYMBOL(__down_failed_trylock); | ||
14 | EXPORT_SYMBOL(__up_wakeup); | ||
15 | 3 | ||
16 | /* Networking helper routines. */ | 4 | /* Networking helper routines. */ |
17 | EXPORT_SYMBOL(csum_partial); | 5 | EXPORT_SYMBOL(csum_partial); |
diff --git a/arch/um/sys-ppc/Makefile b/arch/um/sys-ppc/Makefile index 08901526e893..b8bc844fd2c4 100644 --- a/arch/um/sys-ppc/Makefile +++ b/arch/um/sys-ppc/Makefile | |||
@@ -3,7 +3,7 @@ OBJ = built-in.o | |||
3 | .S.o: | 3 | .S.o: |
4 | $(CC) $(KBUILD_AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o | 4 | $(CC) $(KBUILD_AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o |
5 | 5 | ||
6 | OBJS = ptrace.o sigcontext.o semaphore.o checksum.o miscthings.o misc.o \ | 6 | OBJS = ptrace.o sigcontext.o checksum.o miscthings.o misc.o \ |
7 | ptrace_user.o sysrq.o | 7 | ptrace_user.o sysrq.o |
8 | 8 | ||
9 | EXTRA_AFLAGS := -DCONFIG_PPC32 -I. -I$(srctree)/arch/ppc/kernel | 9 | EXTRA_AFLAGS := -DCONFIG_PPC32 -I. -I$(srctree)/arch/ppc/kernel |
@@ -20,10 +20,6 @@ ptrace_user.o: ptrace_user.c | |||
20 | sigcontext.o: sigcontext.c | 20 | sigcontext.o: sigcontext.c |
21 | $(CC) $(USER_CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $< | 21 | $(CC) $(USER_CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $< |
22 | 22 | ||
23 | semaphore.c: | ||
24 | rm -f $@ | ||
25 | ln -s $(srctree)/arch/ppc/kernel/$@ $@ | ||
26 | |||
27 | checksum.S: | 23 | checksum.S: |
28 | rm -f $@ | 24 | rm -f $@ |
29 | ln -s $(srctree)/arch/ppc/lib/$@ $@ | 25 | ln -s $(srctree)/arch/ppc/lib/$@ $@ |
@@ -66,4 +62,4 @@ misc.o: misc.S ppc_defs.h | |||
66 | $(CC) $(EXTRA_AFLAGS) $(KBUILD_AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o | 62 | $(CC) $(EXTRA_AFLAGS) $(KBUILD_AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o |
67 | rm -f asm | 63 | rm -f asm |
68 | 64 | ||
69 | clean-files := $(OBJS) ppc_defs.h checksum.S semaphore.c mk_defs.c | 65 | clean-files := $(OBJS) ppc_defs.h checksum.S mk_defs.c |
diff --git a/arch/um/sys-x86_64/ksyms.c b/arch/um/sys-x86_64/ksyms.c index 12c593607c59..4d7d1a812d8f 100644 --- a/arch/um/sys-x86_64/ksyms.c +++ b/arch/um/sys-x86_64/ksyms.c | |||
@@ -1,16 +1,5 @@ | |||
1 | #include "linux/module.h" | 1 | #include "linux/module.h" |
2 | #include "linux/in6.h" | 2 | #include "asm/string.h" |
3 | #include "linux/rwsem.h" | ||
4 | #include "asm/byteorder.h" | ||
5 | #include "asm/semaphore.h" | ||
6 | #include "asm/uaccess.h" | ||
7 | #include "asm/checksum.h" | ||
8 | #include "asm/errno.h" | ||
9 | |||
10 | EXPORT_SYMBOL(__down_failed); | ||
11 | EXPORT_SYMBOL(__down_failed_interruptible); | ||
12 | EXPORT_SYMBOL(__down_failed_trylock); | ||
13 | EXPORT_SYMBOL(__up_wakeup); | ||
14 | 3 | ||
15 | /*XXX: we need them because they would be exported by x86_64 */ | 4 | /*XXX: we need them because they would be exported by x86_64 */ |
16 | EXPORT_SYMBOL(__memcpy); | 5 | EXPORT_SYMBOL(__memcpy); |