linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Clark Williams <williams@redhat.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>, RT <linux-rt-users@vger.kernel.org>
Subject: [PATCH RT]  rt: add rwsem_is_contended() definition to rwsem_rt.h
Date: Wed, 27 Aug 2014 16:09:28 -0500	[thread overview]
Message-ID: <20140827160928.6f323642@sluggy> (raw)

[-- 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 --]

             reply	other threads:[~2014-08-27 21:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-27 21:09 Clark Williams [this message]
2015-02-17 10:09 ` [PATCH RT] rt: add rwsem_is_contended() definition to rwsem_rt.h Sebastian Andrzej Siewior
2015-02-17 19:08   ` Clark Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140827160928.6f323642@sluggy \
    --to=williams@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).