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

Linus Torvalds
2005-12-17T07:34:50Z

On Fri, 16 Dec 2005, Steven Rostedt wrote:
>
> So how does one handle real-time tasks that must contend with locks within
> the kernel that is shared with low priority tasks? Do you prefer the RTAI
> approach?

If you want hard real-time, either that, or just make sure you don't get
locks that might be slow (for one reason or another). Finer granularities
help there.

For example, to make things really concrete, please just name a semaphore
that is relevant to a real-time task and that isn't fine enough grain that
a careful and controlled environment can't avoid it being a bottle-neck
for a real-time task.

The real problems often end up happening in things like memory management,
and waiting for IO, where it's not about the locking at all, it's about
event scheduling. And you just have to avoid those (through pre-allocation
and buffering) in those kinds of real-time situations.

I really can't think of any blocking kernel lock where priority
inheritance would make _any_ sense at all. Please give me an example.

Linus