From 2028b2a96c7339e1d188f3febd27b46fe741d94a Mon Sep 17 00:00:00 2001 From: Nicholas Mc Guire 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. Signed-off-by: Nicholas Mc Guire Signed-off-by: Sebastian Andrzej Siewior --- kernel/locking/rt.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/kernel/locking/rt.c b/kernel/locking/rt.c index 81a9b878434b..df92fbe6d392 100644 --- a/kernel/locking/rt.c +++ b/kernel/locking/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; }