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>
This commit is contained in:
parent
d5af4a6a85
commit
2028b2a96c
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue