From: Thomas Gleixner <tglx@xxxxxxxxxxxxx>.....
Similar to rw_semaphores on RT the rwlock substitution is not writer fair
because it's not feasible to have a writer inherit it's 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@xxxxxxxxxxxxx>
---
V5: Add missing might_sleep() and fix lockdep init (Sebastian)
---
include/linux/rwlock_rt.h | 140 ++++++++++++++++++++++++++++++++++++++++
include/linux/rwlock_types.h | 49 ++++++++++----
include/linux/spinlock_rt.h | 2
kernel/Kconfig.locks | 2
kernel/locking/spinlock.c | 7 ++
kernel/locking/spinlock_debug.c | 5 +
kernel/locking/spinlock_rt.c | 131 +++++++++++++++++++++++++++++++++++++
7 files changed, 323 insertions(+), 13 deletions(-)
create mode 100644 include/linux/rwlock_rt.h
---
+
+int __sched rt_rwlock_is_contended(rwlock_t *rwlock)
+{
+ return rw_base_is_contended(&rwlock->rwbase);
+}
+EXPORT_SYMBOL(rt_rwlock_is_contended);
+