2014-04-16 23:10:15 +00:00
|
|
|
From 56f43bce737d3f28ad470c95fa84f824cb0d55ad 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 2/2] condition migration_disable on lock acquisition
|
2014-05-13 18:04:41 +00:00
|
|
|
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/3.14/patches-3.14.3-rt5.tar.xz
|
2014-04-16 23:10:15 +00:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
|
|
|
|
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|
|
|
---
|
|
|
|
kernel/locking/rt.c | 7 +++----
|
|
|
|
1 file changed, 3 insertions(+), 4 deletions(-)
|
|
|
|
|
|
|
|
--- a/kernel/locking/rt.c
|
|
|
|
+++ b/kernel/locking/rt.c
|
|
|
|
@@ -182,11 +182,10 @@ int __lockfunc rt_write_trylock(rwlock_t
|
|
|
|
{
|
|
|
|
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;
|
|
|
|
}
|