linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RT]  rt: add rwsem_is_contended() definition to rwsem_rt.h
@ 2014-08-27 21:09 Clark Williams
  2015-02-17 10:09 ` Sebastian Andrzej Siewior
  0 siblings, 1 reply; 3+ messages in thread
From: Clark Williams @ 2014-08-27 21:09 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: LKML, RT

[-- Attachment #1: Type: text/plain, Size: 932 bytes --]

Thomas,

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 <williams@redhat.com>
---
 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);
 }
 #endif
+
+static inline int rwsem_is_contended(struct rw_semaphore *sem)
+{
+       return !plist_head_empty(&sem->lock.wait_list);
+}
 #endif

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-02-17 19:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-27 21:09 [PATCH RT] rt: add rwsem_is_contended() definition to rwsem_rt.h Clark Williams
2015-02-17 10:09 ` Sebastian Andrzej Siewior
2015-02-17 19:08   ` Clark Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).