Re: [2.4.17/18pre] VM and swap - it's really unusable

Robert Love
2002-01-14T20:17:13Z

On Mon, 2002-01-14 at 13:04, Oliver Neukum wrote:

> It can happen if you sleep with a lock held.
> It can not happen at random points in the code.
> Thus there is a relation to preemption in kernel mode.
>
> To cure that problem tasks holding a lock would have to be given
> the highest priority of all tasks blocking on that lock. The semaphore
> code would get much more complex, even in the succesful code path,
> which would hurt a lot.

No, this isn't needed. This same problem would occur without
preemption. Our semaphores now have locking rules such that we aren't
going to have blatant priority inversion like this (1 holds A needs B, 2
holds B needs A).

When priority inversion begins to become a problem is if we intend to
start turning existing spinlocks into semaphores. There the locking
rules are weaker, and thus we would need to do priority inheriting. But
that's not now.

Robert Love