rtmutex: No need to keep task ref for lock owner check
upstream commit: 2ffa5a5cd2
There is no point to keep the task ref across the check for lock
owner. Drop the ref before that, so the protection context is clear.
Found while documenting the chain walk.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
Reviewed-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
This commit is contained in:
parent
b69f25004a
commit
5c1c8184e8
|
@ -484,6 +484,8 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task,
|
||||||
|
|
||||||
/* Release the task */
|
/* Release the task */
|
||||||
raw_spin_unlock_irqrestore(&task->pi_lock, flags);
|
raw_spin_unlock_irqrestore(&task->pi_lock, flags);
|
||||||
|
put_task_struct(task);
|
||||||
|
|
||||||
if (!rt_mutex_owner(lock)) {
|
if (!rt_mutex_owner(lock)) {
|
||||||
struct rt_mutex_waiter *lock_top_waiter;
|
struct rt_mutex_waiter *lock_top_waiter;
|
||||||
|
|
||||||
|
@ -495,9 +497,8 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task,
|
||||||
if (top_waiter != lock_top_waiter)
|
if (top_waiter != lock_top_waiter)
|
||||||
rt_mutex_wake_waiter(lock_top_waiter);
|
rt_mutex_wake_waiter(lock_top_waiter);
|
||||||
raw_spin_unlock(&lock->wait_lock);
|
raw_spin_unlock(&lock->wait_lock);
|
||||||
goto out_put_task;
|
return 0;
|
||||||
}
|
}
|
||||||
put_task_struct(task);
|
|
||||||
|
|
||||||
/* Grab the next task */
|
/* Grab the next task */
|
||||||
task = rt_mutex_owner(lock);
|
task = rt_mutex_owner(lock);
|
||||||
|
|
Loading…
Reference in New Issue