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

From: Steven Rostedt
Date: Tue Jan 04 2011 - 13:06:12 EST

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

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

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


-- 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
Please read the FAQ at