From: Nicholas Mc Guire <der.herr@hofr.at>
To: linux-rt-users@vger.kernel.org
Cc: Peter Zijlstra <peterz@infradead.org>,
Steven Rostedt <rostedt@goodmis.org>,
Andreas Platschek <platschek@ict.tuwien.ac.at>
Subject: [PATCH] condition migration_disable on lock acquisition
Date: Fri, 22 Nov 2013 05:42:23 +0100 [thread overview]
Message-ID: <20131122044223.GB31849@opentech.at> (raw)
In-Reply-To: <20131120102107.GA12022@opentech.at>
>From a73aed45d686f800871ba0342cd223bf23e70302 Mon Sep 17 00:00:00 2001
From: Nicholas Mc Guire <der.herr@hofr.at>
Date: Thu, 21 Nov 2013 22:52:30 -0500
Subject: [PATCH] condition migration_disable on lock acquisition
No need to unconditionally migrate_disable (what is it protecting ?) and
re-enable on failure to acquire the lock.
This patch moves the migrate_disable to be conditioned on sucessful lock
acquisition only.
No change of functionality
Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
---
kernel/rt.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/kernel/rt.c b/kernel/rt.c
index 433ae42..4b2c4a9 100644
--- a/kernel/rt.c
+++ b/kernel/rt.c
@@ -182,11 +182,10 @@ int __lockfunc rt_write_trylock(rwlock_t *rwlock)
{
int ret = rt_mutex_trylock(&rwlock->lock);
- migrate_disable();
- if (ret)
+ if (ret) {
rwlock_acquire(&rwlock->dep_map, 0, 1, _RET_IP_);
- else
- migrate_enable();
+ migrate_disable();
+ }
return ret;
}
--
1.7.2.5
next prev parent reply other threads:[~2013-11-22 4:42 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-20 10:21 [PATCH 1/2] remove recursive call to migrate_disable in read_lock_bh Nicholas Mc Guire
2013-11-21 10:22 ` Peter Zijlstra
2013-11-21 11:14 ` Nicholas Mc Guire
2013-11-21 23:58 ` Nicholas Mc Guire
2013-11-22 4:42 ` Nicholas Mc Guire [this message]
2013-11-22 18:39 ` [PATCH] condition migration_disable on lock acquisition Sebastian Andrzej Siewior
2013-11-27 0:26 ` Thomas Gleixner
2013-11-22 4:44 ` [PATCH] drop recursive migrate_disable in rt_write_trylock_irqsave Nicholas Mc Guire
2013-11-22 17:15 ` Sebastian Andrzej Siewior
2013-11-22 5:09 ` [PATCH] drop recursive migrate_disable in rt_write_trylock_irqsave - the right one this time Nicholas Mc Guire
2013-11-22 17:17 ` Sebastian Andrzej Siewior
2013-11-22 16:12 ` [PATCH 1/2] remove recursive call to migrate_disable in read_lock_bh Sebastian Andrzej Siewior
2013-11-22 23:39 ` Nicholas Mc Guire
2013-11-29 14:54 ` Sebastian Andrzej Siewior
2013-11-30 1:58 ` Nicholas Mc Guire
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=20131122044223.GB31849@opentech.at \
--to=der.herr@hofr.at \
--cc=linux-rt-users@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=platschek@ict.tuwien.ac.at \
--cc=rostedt@goodmis.org \
/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).