[Techtalk] Theory vs. practice

Raven, corporate courtesan raven at oneeyedcrow.net
Tue Jan 15 19:35:22 EST 2002

Heya --

Quoth Val Henson (Tue, Jan 15, 2002 at 03:29:14PM -0700):
> What's wrong with this picture?  A Platinum account holder just spent
> 3 hours waiting for a Gold account holder, when theoretically, the
> Platinum holder should have had first priority.

	Okay, I can see that that's bad.  Is there a way to quickly
check which processes are freeing up resources rather than requesting
them, and then assign a higher priority to those?  Something to the
effect of "need $100, who's releasing $100?  You?  Up front!".  You
could even do some sort of secondary categorization, such that if you
had a Platinum account needing $100, and you had a Gold account waiting
to deposit $100 and a Silver account waiting to deposit $100, that the
Gold account would get priority over the silver even under the new
"who's got $100" system.

	I don't know how that would work precisely under the internals
of the kernel, but the general idea seems sound.

> And that medium priority process can have an infinite amount of
> work to do, making it possible that neither the low or high priority
> process will _ever_ run again.

	Right, I'm guessing that some internal system checking things
could work this way.
> Linux gets around this by introducing the concept of "fairness" (I'm
> ignoring the "realtime" priorities).  Each process does eventually get
> to run for a while, even if a higher priority process still wants the
> CPU.  It's very egalitarian. :)

	Like Cisco's weighted fair queueing (for the network geeks out
there).  How is the weighting determined?  Is it effectively "priority
Gold, but if you haven't had any attention in 3,000 cycles you become
effectively priority platinum for 50 cycles, and then drop back down to
Gold until either you get your Gold turn or another 3,000 cycles have
gone by..."?  And if there are set limits like that, how do you ensure
that there aren't so many medium priority processes running that they're
stealing 90% of the CPU, even though you have a high-priority process
that needs attention?

> No, that's the whole point - you never know how many old ladies with
> huge bags of pennies and Gold accounts are hogging the processor.

	Heh, no kidding.  I see this all the time with BGP processes and
Cisco's IOS.
> Some people say priority inheritance is the cure.  Anyone want to hear
> about that? :)

	Yah, this is really interesting.


More information about the Techtalk mailing list