Re: [SHED] Questions.

From: Ian Kumlien
Date: Sun Aug 31 2003 - 19:02:32 EST


On Mon, 2003-09-01 at 01:41, Robert Love wrote:
> On Sun, 2003-08-31 at 18:41, Ian Kumlien wrote:
>
> > hummm, I assume that a high pri process can preempt a low pri process...
> > The rest sounds sane to me =), Please tell me what i'm missing.. =)
>
> No no. The rule is "the highest priority process with timeslice
> remaining runs" not just "the highest priority process runs."

Then i'm beginning to agree with the time unit... Large timeslice but in
units for high pri tasks... So that high pri can run (if needed) 2 or 3
times / timeslice.

More like MAX_QUANT_ON_QUEUE/MIN_QUANT or so...

> Otherwise, timeslice wouldn't matter much!

Just sounds odd to me.

> When a process exhausts its timeslice, it is moved to the "expired"
> list. When all currently running tasks expire their timeslice, the
> scheduler begins servicing from the "expired" list (which then becomes
> the "active" list, and the old active list becomes the expired).

Ok, good solution

> This implies that a high priority, which has exhausted its timeslice,
> will not be allowed to run again until _all_ other runnable tasks
> exhaust their timeslice (this ignores the reinsertion into the active
> array of interactive tasks, but that is an optimization that just
> complicates this discussion).

So it's penalised by being in the corner for one go? or just pri
penalised (sounds like it could get a corner from what you wrote... Or
is it time for bed).

> If timeslices did not play a role, then high priority tasks would always
> monopolize the system.

> This is a classic priority-based round-robin scheduler.

> > > Once a task exhausts its timeslice, it cannot run until all other tasks
> > > exhaust their timeslice. If this were not the case, high priority tasks
> > > could monopolize the system.
> >
> > All other? including sleeping?... How many tasks can be assumed to run
> > on the cpu at a time?....
>
> I wasn't clear: all other _runnable_ tasks.

Yes, but how many runable tasks would you have on a system in one go,
while maintaining interactivity...
(Ie, what amount would the scheduler actually have to deal with..)

> Once a task "expires" (exhausts its timeslice), it will not run again
> until all other tasks, even those of a lower priority, exhaust their
> timeslice.

Yeah, it seems like my idea would need several run queues with diff
timeslices to make up.

> This is a major difference between normal tasks and real-time tasks.
>
> > Should preempt send the new quantum value to all "low pri, high quantum"
> > processes?
>
> I don't follow this?

Never mind, bad idea, sucky thing... =P

> > Damn thats a tough cookie, i still think that the priority inversion is
> > bad. Don't know enough about this to actually provide a solution...
> > Any one else that has a view point?
>
> Priority inversion is bad, but the priority inversion in this case is
> intended. Higher priority tasks cannot starve lower ones. It is a
> classic Unix philosophy that 'all tasks make some forward progress'

Yes, like the feedback scheduler...

> If you need to guarantee that a task always runs when runnable, you want
> real-time.

... yes... =)

> If you just want to give a scheduling boost, to ensure greater
> runnability, lower latency, and larger timeslices... nice values
> suffice.

nicevalues/pri is always the best way imho.

> > Hummm, the skips in xmms tells me that something is bad..
> > (esp since it works perfectly on the previus scheduler)
>
> A lot of this is just the interactivity estimator making the wrong
> estimate.

Yes, But... When you come from AmigaOS, and have used Executive...
things like this is dis concerning. Executive is a scheduler addition
for amigaos that has many schedulers to choose from. One of which is the
original feedback scheduler. While a feedback scheduler consumes some
cpu it still allows you to play mp3's while surfing the net on a 50 mhz
68060. Hearing about 500mhz machines that skip is somewhat.. odd.

And afair it has no real interactivity estimator.

(If you are interested you can always search for Executive on aminet..
It has several scheduler policies including those that work great on
small machines (25mhz or so))

> > Since it's rescheduled after a short runtime or, might be.
> > From someones mail i saw (afair), there was much more context switches
> > in 2.6 than in 2.4. And each schedule consumes time and cycles.
>
> Context switches (as in process to process changes) should be about the
> same?

Apparently they are not... I should have saved the link...

> Interrupt frequency has gone up in x86 (1000 vs 100). Maybe that is
> what they are seeing.

I dunno, i didn't pay that much attention and i can't find it now =P

> > Oh yes, but otoh, if you are really keen on the latency then you'll do
> > realtime =)
>
> Agreed. But at the same time, not every "interactive" task should be
> real-time. In fact, nearly all should not. I do not want my text
> editor or mailer to be RT, for example.

Well, there is latency and there is latency. To take the AmigaOS
example. Voyager, a webbrowser for AmigaOS uses MUI (a fully dynamic gui
with weighted(prioritized) sections) and renders images. It's responsive
even on a 40mhz 68040 using Executive with the feedback scheduler.

500 mhz is a lot of horsepower when it comes to playing mp3's and
scheduling.. It feels like something is wrong when i see all these
discussions but i most certainly don't know enough to even begin to
understand it. I only tried to show the thing i thought was really wrong
but you do have a point with the runqueues and timeslices =P

> They just need a scheduling boost.

imho, that shouldn't really be needed... =P
(although executive apparently had a pri boost for active window... I
doubt that i ran with it though... Been a while =))

--
Ian Kumlien <pomac@xxxxxxxxx>

Attachment: signature.asc
Description: This is a digitally signed message part