Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation

Matthew Wilcox
2005-12-17T23:43:10Z

On Fri, Dec 16, 2005 at 11:34:03PM -0800, Linus Torvalds wrote:
> I really can't think of any blocking kernel lock where priority
> inheritance would make _any_ sense at all. Please give me an example.

I have a better example of something we currently get wrong that I
haven't heard any RT person worry about yet. If two tasks are sleeping
on the same semaphore, the one to be woken up will be the first one to
wait for it, not the highest-priority task.

Obviously, this was introduced by the wake-one semantics. But how to
fix it? Should we scan the entire queue looking for the best task to
wake? Should we try to maintain the wait list in priority order? Or
should we just not care? Should we document that we don't care? ;-)