aboutsummaryrefslogtreecommitdiff
path: root/include/linux/rwsem-spinlock.h
AgeCommit message (Collapse)AuthorFilesLines
2014-07-16locking/rwsem: Rename 'activity' to 'count'Peter Zijlstra1-4/+4
There are two definitions of struct rw_semaphore, one in linux/rwsem.h and one in linux/rwsem-spinlock.h. For some reason they have different names for the initial field. This makes it impossible to use C99 named initialization for __RWSEM_INITIALIZER() -- or we have to duplicate that entire thing along with the structure definitions. The simpler patch is renaming the rwsem-spinlock variant to match the regular rwsem. This allows us to switch to C99 named initialization. Signed-off-by: Peter Zijlstra <[email protected]> Cc: Linus Torvalds <[email protected]> Link: http://lkml.kernel.org/n/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
2011-09-13locking, rwsem: Annotate inner lock as rawThomas Gleixner1-1/+1
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 <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2011-01-27rwsem: Move duplicate init macros and functions to linux/rwsem.hThomas Gleixner1-22/+1
The rwsem initializers and related macros and functions are mostly the same. Some of them lack the lockdep initializer, but having it in place does not matter for architectures which do not support lockdep. powerpc, sparc, x86: No functional change sh, s390: Removes the duplicate init_rwsem (inline and #define) alpha, ia64, xtensa: Use the lockdep capable init function in lib/rwsem.c which is just uninlining the init function for the LOCKDEP=n case Signed-off-by: Thomas Gleixner <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: David Howells <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Matt Turner <[email protected]> Acked-by: Tony Luck <[email protected]> Acked-by: Heiko Carstens <[email protected]> Cc: Paul Mundt <[email protected]> Acked-by: David Miller <[email protected]> Cc: Chris Zankel <[email protected]> LKML-Reference: <[email protected]>
2011-01-27rwsem: Cleanup includesThomas Gleixner1-8/+0
All rwsem implementations include the same headers. Include them from include/linux/rwsem.h Signed-off-by: Thomas Gleixner <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: David Howells <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Matt Turner <[email protected]> Acked-by: Tony Luck <[email protected]> Acked-by: Heiko Carstens <[email protected]> Cc: Paul Mundt <[email protected]> Acked-by: David Miller <[email protected]> Cc: Chris Zankel <[email protected]> LKML-Reference: <[email protected]>
2009-12-15rwsem: fix rwsem_is_locked() bugsAmerigo Wang1-5/+1
rwsem_is_locked() tests ->activity without locks, so we should always keep ->activity consistent. However, the code in __rwsem_do_wake() breaks this rule, it updates ->activity after _all_ readers waken up, this may give some reader a wrong ->activity value, thus cause rwsem_is_locked() behaves wrong. Quote from Andrew: " - we have one or more processes sleeping in down_read(), waiting for access. - we wake one or more processes up without altering ->activity - they start to run and they do rwsem_is_locked(). This incorrectly returns "false", because the waker process is still crunching away in __rwsem_do_wake(). - the waker now alters ->activity, but it was too late. " So we need get a spinlock to protect this. And rwsem_is_locked() should not block, thus we use spin_trylock_irqsave(). [[email protected]: simplify code] Reported-by: Brian Behlendorf <[email protected]> Cc: Ben Woodard <[email protected]> Cc: David Howells <[email protected]> Signed-off-by: WANG Cong <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-02-13include/linux: Remove all users of FASTCALL() macroHarvey Harrison1-8/+8
FASTCALL() is always expanded to empty, remove it. [[email protected]: coding-style fixes] Signed-off-by: Harvey Harrison <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-12-07[PATCH] lockdep: name some old style locksPeter Zijlstra1-1/+2
Name some of the remaning 'old_style_spin_init' locks Signed-off-by: Peter Zijlstra <[email protected]> Acked-by: Ingo Molnar <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-07-03[PATCH] lockdep: prove rwsem locking correctnessIngo Molnar1-2/+21
Use the lock validator framework to prove rwsem locking correctness. Signed-off-by: Ingo Molnar <[email protected]> Signed-off-by: Arjan van de Ven <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-07-03[PATCH] lockdep: clean up rwsemsIngo Molnar1-13/+1
Clean up rwsems. Signed-off-by: Ingo Molnar <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2005-10-29[PATCH] add sem_is_read/write_locked()Rik Van Riel1-0/+5
Add sem_is_read/write_locked functions to the read/write semaphores, along the same lines of the *_is_locked spinlock functions. The swap token tuning patch uses sem_is_read_locked; sem_is_write_locked is added for completeness. Signed-off-by: Rik van Riel <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2005-04-16Linux-2.6.12-rc2Linus Torvalds1-0/+65
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!