Diffstat (limited to 'include/linux/sched.h')
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 6e3a5eeec509..5d1378e5a040 100644
@@ -1912,6 +1912,23 @@ static inline int spin_needbreak(spinlock_t *lock)
+ * Check if a rwlock is contended.
+ * Returns non-zero if there is another task waiting on the rwlock.
+ * Returns zero if the lock is not contended or the system / underlying
+ * rwlock implementation does not support contention detection.
+ * Technically does not depend on CONFIG_PREEMPTION, but a general need
+ * for low latency.
+static inline int rwlock_needbreak(rwlock_t *lock)
+ return rwlock_is_contended(lock);
+ return 0;
static __always_inline bool need_resched(void)