summaryrefslogtreecommitdiff
path: root/kernel/rt.c
diff options
context:
space:
mode:
authorNicholas Mc Guire <der.herr@hofr.at>2013-11-22 03:52:30 (GMT)
committerScott Wood <scottwood@freescale.com>2014-04-10 00:19:26 (GMT)
commitea6767f8b4469261eb3b5e9308ff170bcfbfa7bf (patch)
treecbf4056a5d9c55ee1bee44bf698e6785372c8996 /kernel/rt.c
parent73ae55fd4fdfc9fc7c07e86fb7278db47edf11fb (diff)
downloadlinux-fsl-qoriq-ea6767f8b4469261eb3b5e9308ff170bcfbfa7bf.tar.xz
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. Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Diffstat (limited to 'kernel/rt.c')
-rw-r--r--kernel/rt.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/kernel/rt.c b/kernel/rt.c
index 92a16e1..ff56d3c 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;
}