linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robert Love <rml@tech9.net>
To: Ian Kumlien <pomac@vapor.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [SHED] Questions.
Date: Sun, 31 Aug 2003 19:41:14 -0400	[thread overview]
Message-ID: <1062373274.1313.28.camel@boobies.awol.org> (raw)
In-Reply-To: <1062369684.9959.166.camel@big.pomac.com>

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."

Otherwise, timeslice wouldn't matter much!

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).

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).

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.

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.

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?

> 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'

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

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

> 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.

> 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?

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

> 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.

They just need a scheduling boost.

	Robert Love



  reply	other threads:[~2003-08-31 23:30 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-31 10:07 [SHED] Questions Ian Kumlien
2003-08-31 10:17 ` Nick Piggin
2003-08-31 10:24   ` Ian Kumlien
2003-08-31 10:41     ` Nick Piggin
2003-08-31 10:46       ` Nick Piggin
     [not found]       ` <1062326980.9959.65.camel@big.pomac.com>
     [not found]         ` <3F51D4A4.4090501@cyberone.com.au>
2003-08-31 11:08           ` Ian Kumlien
2003-08-31 11:31             ` Nick Piggin
2003-08-31 11:43               ` Ian Kumlien
2003-08-31 18:53 ` Robert Love
2003-08-31 19:31   ` Ian Kumlien
2003-08-31 19:51     ` Robert Love
2003-08-31 22:41       ` Ian Kumlien
2003-08-31 23:41         ` Robert Love [this message]
2003-09-01  0:00           ` Ian Kumlien
2003-09-01  2:50             ` Con Kolivas
2003-09-01 15:58               ` Antonio Vargas
2003-09-01 22:19               ` Ian Kumlien
2003-09-01  4:03             ` Robert Love
2003-09-01  5:07               ` Con Kolivas
2003-09-01  5:55                 ` Robert Love
2003-09-01 22:24               ` Ian Kumlien
2003-09-01 14:21             ` Antonio Vargas
2003-09-01 19:36               ` Geert Uytterhoeven
2003-09-01 22:49               ` Ian Kumlien
2003-09-01 15:07           ` Daniel Phillips
2003-09-01 14:16             ` Antonio Vargas
2003-09-01 23:03             ` Ian Kumlien
2003-09-02  0:04               ` Nick Piggin
2003-09-02  0:23               ` Con Kolivas
2003-09-02 10:25                 ` Ian Kumlien
2003-09-02 11:08                   ` Nick Piggin
2003-09-02 17:22                     ` Ian Kumlien
2003-09-02 23:49                       ` Nick Piggin
2003-09-03 23:02                         ` Ian Kumlien
2003-09-04  1:39                           ` Mike Fedyk
2003-09-02 10:44                 ` Wes Janzen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1062373274.1313.28.camel@boobies.awol.org \
    --to=rml@tech9.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pomac@vapor.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).