[lkml]   [2014]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH RT] rt: add rwsem_is_contended() definition to rwsem_rt.h

The latest btrfs code uses rwsem_is_contended() in the function
caching_thread(). On RT systems, include/linux/rwsem.h is replaced with
include/linux/rwsem_rt.h which does not provide a definition for
rwsem_is_contended(). This commit provides a definition that should
work on RT (where the lock is actually an rt_mutex).

Signed-off-by: Clark Williams <>
include/linux/rwsem_rt.h | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/include/linux/rwsem_rt.h b/include/linux/rwsem_rt.h
index e94d945c5844..77035d7abc04 100644
--- a/include/linux/rwsem_rt.h
+++ b/include/linux/rwsem_rt.h
@@ -125,4 +125,9 @@ static inline void down_write_nest_lock(struct rw_semaphore *sem,
rt_down_write_nested_lock(sem, NULL);
+static inline int rwsem_is_contended(struct rw_semaphore *sem)
+ return !plist_head_empty(&sem->lock.wait_list);
#endif[unhandled content-type:application/pgp-signature]
 \ /
  Last update: 2014-08-27 23:21    [W:0.043 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site