If there's no complaints about it. I'm going to add this to the 3.12-rt
stable tree. As without it, it fails horribly with the cpu hotplug
stress test, and I wont release a stable kernel that does that.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
*/
int __lockfunc rt_write_trylock(rwlock_t *rwlock)
{
- int ret = rt_mutex_trylock(&rwlock->lock);
+ int ret;
- if (ret) {
+ migrate_disable();
+ ret = rt_mutex_trylock(&rwlock->lock);
+ if (ret)
rwlock_acquire(&rwlock->dep_map, 0, 1, _RET_IP_);
- migrate_disable();
- }
+ else
+ migrate_enable();
return ret;
}
* write locked.
*/
if (rt_mutex_owner(lock) != current) {
+ migrate_disable();
ret = rt_mutex_trylock(lock);
- if (ret)
- migrate_disable();
+ if (!ret)
+ migrate_enable();
} else if (!rwlock->read_depth) {
ret = 0;
* recursive read locks succeed when current owns the lock
*/
if (rt_mutex_owner(lock) != current) {
- __rt_spin_lock(lock);
migrate_disable();
+ __rt_spin_lock(lock);
}
rwlock->read_depth++;
}