Re: priority inversion

Bernd Paysan (bernd.paysan@gmx.de)
Fri, 30 Jul 1999 11:09:55 +0000


Matthew Wilcox wrote:
> Linux has never had a mechanism to deal with priority inversion since
> it was first introduced (in 2.0, I believe?). Victor Yodaiken gave an
> excellent presentation at Linux Expo about why priority inheritance is
> a stupid idea, but that particular section isn't in the Proceedings.

I don't think priority inheritance is necessarily complex. It requires a
different scheduler algorithm, though. With my proposed O(1) scheduler
(I really should take the time to implement it!), one would proceed as
follows (if a lock is needed):

Deschedule the current process, that goes first into the slot of the
bucked sorted process list. Put the lock-holder there before (if it
isn't already running on another processor), and set needs_reschedule.
Schedule the best process (which is quite likely that one, so it can
release the lock quickly). When returning from the kernel propper, check
the needs_reschedule flag, which puts the current process back to the
bucket it belongs to, and gets back to the stalled process.

The real solution is to eliminate non-spinning kernel locks completely.
I won't worry about user locks (such as flock), because a RT process
writing to a potentially locked file is doomed, anyway.

-- 
Bernd Paysan

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/