locking/rwlock: Provide RT variant
Similar to rw_semaphores, on RT the rwlock substitution is not writer fair, because it's not feasible to have a writer inherit its priority to multiple readers. Readers blocked on a writer follow the normal rules of priority inheritance. Like RT spinlocks, RT rwlocks are state preserving across the slow lock operations (contended case). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20210815211303.882793524@linutronix.de
This commit is contained in:
committed by
Ingo Molnar
parent
0f383b6dc9
commit
8282947f67
@@ -31,6 +31,7 @@ void __raw_spin_lock_init(raw_spinlock_t *lock, const char *name,
|
||||
|
||||
EXPORT_SYMBOL(__raw_spin_lock_init);
|
||||
|
||||
#ifndef CONFIG_PREEMPT_RT
|
||||
void __rwlock_init(rwlock_t *lock, const char *name,
|
||||
struct lock_class_key *key)
|
||||
{
|
||||
@@ -48,6 +49,7 @@ void __rwlock_init(rwlock_t *lock, const char *name,
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(__rwlock_init);
|
||||
#endif
|
||||
|
||||
static void spin_dump(raw_spinlock_t *lock, const char *msg)
|
||||
{
|
||||
@@ -139,6 +141,7 @@ void do_raw_spin_unlock(raw_spinlock_t *lock)
|
||||
arch_spin_unlock(&lock->raw_lock);
|
||||
}
|
||||
|
||||
#ifndef CONFIG_PREEMPT_RT
|
||||
static void rwlock_bug(rwlock_t *lock, const char *msg)
|
||||
{
|
||||
if (!debug_locks_off())
|
||||
@@ -228,3 +231,5 @@ void do_raw_write_unlock(rwlock_t *lock)
|
||||
debug_write_unlock(lock);
|
||||
arch_write_unlock(&lock->raw_lock);
|
||||
}
|
||||
|
||||
#endif /* !CONFIG_PREEMPT_RT */
|
||||
|
||||
Reference in New Issue
Block a user