Re: [patch V3 7/7] rtmutex: Avoid pointless requeueing in the deadlock detection chain walk

From: Thomas Gleixner
Date: Tue Jun 10 2014 - 16:45:24 EST


On Tue, 10 Jun 2014, Steven Rostedt wrote:

> On Tue, 10 Jun 2014 19:41:39 +0200 (CEST)
> Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
>
>
> > > On the loop back around, have something like:
> > >
> > > if (top_waiter) {
> > > if (!task_has_pi_waiters(task))
> > > goto out_unlock_pi;
> >
> > The task has at least one pi waiter.
> >
> > > if (!requeue &&
> > > top_waiter != task_top_pi_waiter(task)) {
> > > if (!detect_deadlock)
> > > goto out_unlock_pi;
> > > else
> > > requeue = false;
> > > }
> >
> > Errm? if requeue is off we are in deadlock detection chainwalk
> > mode. So all we care about is whether task is blocked on
> > next_lock or not.
>
> Actually that was a typo on my part. That should have been:
>
> if (requeue &&
> ...
>
> As we don't need to read the task_top_pi_waiter() again.

if (requeue ...

is completely pointless as the code you were talking about is in the

if (!requeue) {

branch. So what?

Thanks,

tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/