From 56f43bce737d3f28ad470c95fa84f824cb0d55ad Mon Sep 17 00:00:00 2001 From: Nicholas Mc Guire Date: Thu, 21 Nov 2013 22:52:30 -0500 Subject: [PATCH 2/2] condition migration_disable on lock acquisition Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/3.14/patches-3.14.0-rt1.tar.xz 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 Signed-off-by: Sebastian Andrzej Siewior --- 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; }