Skip to content

Commit 5dec94d

Browse files
Waiman-LongIngo Molnar
authored andcommitted
locking/rwsem: Merge rwsem.h and rwsem-xadd.c into rwsem.c
Now we only have one implementation of rwsem. Even though we still use xadd to handle reader locking, we use cmpxchg for writer instead. So the filename rwsem-xadd.c is not strictly correct. Also no one outside of the rwsem code need to know the internal implementation other than function prototypes for two internal functions that are called directly from percpu-rwsem.c. So the rwsem-xadd.c and rwsem.h files are now merged into rwsem.c in the following order: <upper part of rwsem.h> <rwsem-xadd.c> <lower part of rwsem.h> <rwsem.c> The rwsem.h file now contains only 2 function declarations for __up_read() and __down_read(). This is a code relocation patch with no code change at all except making __up_read() and __down_read() non-static functions so they can be used by percpu-rwsem.c. Suggested-by: Peter Zijlstra <[email protected]> Signed-off-by: Waiman Long <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Davidlohr Bueso <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Tim Chen <[email protected]> Cc: Will Deacon <[email protected]> Cc: huang ying <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 64489e7 commit 5dec94d

File tree

4 files changed

+891
-900
lines changed

4 files changed

+891
-900
lines changed

kernel/locking/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# and is generally not a function of system call inputs.
44
KCOV_INSTRUMENT := n
55

6-
obj-y += mutex.o semaphore.o rwsem.o percpu-rwsem.o rwsem-xadd.o
6+
obj-y += mutex.o semaphore.o rwsem.o percpu-rwsem.o
77

88
ifdef CONFIG_FUNCTION_TRACER
99
CFLAGS_REMOVE_lockdep.o = $(CC_FLAGS_FTRACE)

0 commit comments

Comments
 (0)