[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140613123005.5c309e98@gandalf.local.home>
Date: Fri, 13 Jun 2014 12:30:05 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>
Subject: Re: [patch V4 04/10] rtmutex: No need to keep task ref for lock
owner check
On Wed, 11 Jun 2014 18:44:05 -0000
Thomas Gleixner <tglx@...utronix.de> wrote:
> 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.
You mean you deobfuscated the code ;-)
(No, patch #3 could have been called "deobfuscate the code")
Reviewed-by: Steven Rostedt <rostedt@...dmis.org>
-- Steve
>
> Found while documenting the chain walk.
>
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> ---
> kernel/locking/rtmutex.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> Index: tip/kernel/locking/rtmutex.c
> ===================================================================
> --- tip.orig/kernel/locking/rtmutex.c
> +++ tip/kernel/locking/rtmutex.c
> @@ -463,6 +463,8 @@ static int rt_mutex_adjust_prio_chain(st
>
> /* Release the task */
> raw_spin_unlock_irqrestore(&task->pi_lock, flags);
> + put_task_struct(task);
> +
> if (!rt_mutex_owner(lock)) {
> /*
> * If the requeue above changed the top waiter, then we need
> @@ -472,9 +474,8 @@ static int rt_mutex_adjust_prio_chain(st
> if (top_waiter != rt_mutex_top_waiter(lock))
> wake_up_process(rt_mutex_top_waiter(lock)->task);
> raw_spin_unlock(&lock->wait_lock);
> - goto out_put_task;
> + return 0;
> }
> - put_task_struct(task);
>
> /* Grab the next task */
> task = rt_mutex_owner(lock);
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists