summaryrefslogtreecommitdiffstats
path: root/include/linux/semaphore.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2010-02-24 09:50:22 +0100
committerIngo Molnar <mingo@elte.hu>2011-09-13 11:11:57 +0200
commit8292c9e15c3b069459794a04f5e2cf0d5665ddc4 (patch)
tree6dd98e626c2dc5fc38a7838295039226b301ee57 /include/linux/semaphore.h
parentee30a7b2fc072f139dac44826860d2c1f422137c (diff)
downloadlinux-stable-8292c9e15c3b069459794a04f5e2cf0d5665ddc4.tar.gz
linux-stable-8292c9e15c3b069459794a04f5e2cf0d5665ddc4.tar.bz2
linux-stable-8292c9e15c3b069459794a04f5e2cf0d5665ddc4.zip
locking, semaphores: Annotate inner lock as raw
There is no reason to have the spin_lock protecting the semaphore preemptible on -rt. Annotate it as a raw_spinlock. 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. ( On rt this also solves lockdep complaining about the rt_mutex.wait_lock being not initialized. ) Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/semaphore.h')
-rw-r--r--include/linux/semaphore.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/semaphore.h b/include/linux/semaphore.h
index 39fa04966aa8..dc368b8ce215 100644
--- a/include/linux/semaphore.h
+++ b/include/linux/semaphore.h
@@ -14,14 +14,14 @@
/* Please don't access any members of this structure directly */
struct semaphore {
- spinlock_t lock;
+ raw_spinlock_t lock;
unsigned int count;
struct list_head wait_list;
};
#define __SEMAPHORE_INITIALIZER(name, n) \
{ \
- .lock = __SPIN_LOCK_UNLOCKED((name).lock), \
+ .lock = __RAW_SPIN_LOCK_UNLOCKED((name).lock), \
.count = n, \
.wait_list = LIST_HEAD_INIT((name).wait_list), \
}