diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2010-02-24 03:54:54 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-09-13 05:11:59 -0400 |
commit | ddb6c9b58a19edcfac93ac670b066c836ff729f1 (patch) | |
tree | 70a9ab2dde08671a050424b0d70fa535472e1345 /include/linux | |
parent | 8292c9e15c3b069459794a04f5e2cf0d5665ddc4 (diff) |
locking, rwsem: Annotate inner lock as raw
There is no reason to allow the lock protecting rwsems (the
ownerless variant) to be preemptible on -rt. Convert it to raw.
In mainline this change documents the low level nature of
the lock - otherwise there's no functional difference. Lockdep
and Sparse checking will work as usual.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/rwsem-spinlock.h | 2 | ||||
-rw-r--r-- | include/linux/rwsem.h | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/include/linux/rwsem-spinlock.h b/include/linux/rwsem-spinlock.h index 34701241b673..d5b13bc07a0b 100644 --- a/include/linux/rwsem-spinlock.h +++ b/include/linux/rwsem-spinlock.h | |||
@@ -22,7 +22,7 @@ | |||
22 | */ | 22 | */ |
23 | struct rw_semaphore { | 23 | struct rw_semaphore { |
24 | __s32 activity; | 24 | __s32 activity; |
25 | spinlock_t wait_lock; | 25 | raw_spinlock_t wait_lock; |
26 | struct list_head wait_list; | 26 | struct list_head wait_list; |
27 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 27 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
28 | struct lockdep_map dep_map; | 28 | struct lockdep_map dep_map; |
diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h index 6a6741440cb7..63d406554391 100644 --- a/include/linux/rwsem.h +++ b/include/linux/rwsem.h | |||
@@ -25,7 +25,7 @@ struct rw_semaphore; | |||
25 | /* All arch specific implementations share the same struct */ | 25 | /* All arch specific implementations share the same struct */ |
26 | struct rw_semaphore { | 26 | struct rw_semaphore { |
27 | long count; | 27 | long count; |
28 | spinlock_t wait_lock; | 28 | raw_spinlock_t wait_lock; |
29 | struct list_head wait_list; | 29 | struct list_head wait_list; |
30 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 30 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
31 | struct lockdep_map dep_map; | 31 | struct lockdep_map dep_map; |
@@ -56,9 +56,11 @@ static inline int rwsem_is_locked(struct rw_semaphore *sem) | |||
56 | # define __RWSEM_DEP_MAP_INIT(lockname) | 56 | # define __RWSEM_DEP_MAP_INIT(lockname) |
57 | #endif | 57 | #endif |
58 | 58 | ||
59 | #define __RWSEM_INITIALIZER(name) \ | 59 | #define __RWSEM_INITIALIZER(name) \ |
60 | { RWSEM_UNLOCKED_VALUE, __SPIN_LOCK_UNLOCKED(name.wait_lock), \ | 60 | { RWSEM_UNLOCKED_VALUE, \ |
61 | LIST_HEAD_INIT((name).wait_list) __RWSEM_DEP_MAP_INIT(name) } | 61 | __RAW_SPIN_LOCK_UNLOCKED(name.wait_lock), \ |
62 | LIST_HEAD_INIT((name).wait_list) \ | ||
63 | __RWSEM_DEP_MAP_INIT(name) } | ||
62 | 64 | ||
63 | #define DECLARE_RWSEM(name) \ | 65 | #define DECLARE_RWSEM(name) \ |
64 | struct rw_semaphore name = __RWSEM_INITIALIZER(name) | 66 | struct rw_semaphore name = __RWSEM_INITIALIZER(name) |