Re: [RFC][RT][PATCH 3/4] rtmutex: Revert Optimize rt lock wakeup

From: Peter W. Morreale
Date: Tue Jan 04 2011 - 15:49:09 EST


On Tue, 2011-01-04 at 13:06 -0500, Steven Rostedt wrote:
> On Tue, 2011-01-04 at 10:45 -0700, Peter W. Morreale wrote:
> > On Tue, 2011-01-04 at 12:27 -0500, Steven Rostedt wrote:
>
> > > That said, I think your wakeup patch may be worth while with Lai's new
> > > code. His changes causes the owner to wake up the pending owner several
> > > times, because the pending owner is never removed from the lock
> > > wait_list. If a high prio task grabs and releases the same lock over and
> > > over, if there is a waiter it will try to wake up that waiter each time.
> > >
> >
> >
> > Oooohhhh I wonder if that would enable 'lock-stealing' for FIFO?
>
> I guess you mean literal FIFO order and not SCHED_FIFO.
>
> But, if I understand you, it would allow for this. If a process has a
> lock and two processes are blocked on it. When the first releases the
> lock it gives it to the higher of the waiters. But if a high prio task
> comes a long, it will steal that lock away, and this woken task will
> need to race to get it from the other lower prio task that comes along.
> And yes, if that other task is the same prio, we reverse the FIFO order
> here.
>
> Lai's patch prevents this. Either the woken task gets the lock or a
> higher prio task does. No mixing around the order of taking the lock
> here. The better side effect of Lai's patch is that it cleans up the
> code quite a bit, which is what I really want, as we start to introduce
> SCHED_DEADLINE.
>

I was referring to one of the original patches that allowing an incoming
task of similar priority to 'steal' the lock over a pending waiter. If
the owner had been cleared and the pending waiter not yet given
ownership, the incoming task could steal the lock.

IIRC, you had found a case wrt SCHED_FIFO tasks that could negatively
impact performance/throughput in some way and it was restricted to
non-SCHED_FIFO tasks.

This was just an idle question, it sounds like RT is moving towards (and
perhaps already there) synchronized lock access.

-PWM


> >
> > IIRC, you came up with a ping-pong scenario that prevented its use
> > there.
>
> Probably.
>
> -- Steve
>
>


--
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/