public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric St-Laurent <ericstl34@sympatico.ca>
To: Nick Piggin <piggin@cyberone.com.au>
Cc: linux-kernel@vger.kernel.org
Subject: Re: scheduler interactivity: timeslice calculation seem wrong
Date: Tue, 19 Aug 2003 00:07:13 -0400	[thread overview]
Message-ID: <1061266033.2900.43.camel@orbiter> (raw)
In-Reply-To: <3F419449.4070104@cyberone.com.au>

> >this is contrary to all process scheduling theory i've read, and also
> >contrary to my intuition.
> Yep.

Yep? What this ack does mean? Books, papers and old unix ways are wrong?
or beyond this theory, practice shows otherwise?

> Its done this way because this is really how the priorities are
> enforced. With some complicated exceptions, every task will be
> allowed to complete 1 timeslice before any task completes 2
> (assuming they don't block).
> 
> So higher priority tasks need bigger timeslices.

Frankly i don't get this part. Maybe i should study the code more, or
perhaps you have an illuminating explanation?

Anyway i always tought linux default timeslice of 100 ms is way too long
for desktop uses. Starting with this in mind, i think that a 10 ms
timeslice should bring back good interactive feel, and by using longer
timeslices for (lower prio) cpu-bound processes, we can save some costly
context switches.

Unfortunatly i'm unable to test those ideas right now but i share them,
maybe it can help other's work.

- (previously mentionned) higher prio tasks should use small timeslices
and lower prio tasks, longer ones. i think, maybe falsely, that this can
lower context switch rate for cpu-bound tasks. by using up to 200 ms
slices instead of 10 ms...

- (previously mentionned) use dynamic priority to calculate timeslice
length.

- maybe adjust the max timeslice length depending on how many tasks are
running/ready.

- timeslices in cycles, instead of ticks, to scale with cpu_khz. maybe
account for the cpu caches size to decide the larger timeslice length.

- a /proc tunable might be needed to let the user choose the
interactivity vs efficiency compromise. for example, with 100 background
tasks, does the user want the most efficiency or prefer wasting some
cycles to get a smoother progress between jobs?

- nanoseconds, or better, cycle accurate (rdtsc) timeslice accouting, it
may help heuristics.

- maybe add some instrumentations, like keeping static and dynamic
priorities, task_struct internal variables and other relevant data for
all processes with each scheduling decisions, that a userspace program
can capture and analyse, to better fine-tune the heuristics.

- lastly, it may be usefull to better encapsulate the scheduler to ease
adding alternative scheduler, much like the i/o schedulers work...


Eric St-Laurent


  reply	other threads:[~2003-08-19  4:07 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-19  2:54 scheduler interactivity: timeslice calculation seem wrong Eric St-Laurent
2003-08-19  3:06 ` Nick Piggin
2003-08-19  4:07   ` Eric St-Laurent [this message]
2003-08-19  5:23     ` Nick Piggin
2003-08-19  6:54       ` Eric St-Laurent
2003-08-19 19:18         ` bill davidsen
2003-08-19 23:48           ` Eric St-Laurent
2003-08-19 23:54           ` Eric St-Laurent
2003-08-19 19:01       ` bill davidsen
2003-08-20  0:15         ` Eric St-Laurent
2003-08-20  0:32           ` David Lang
2003-08-20  0:48             ` William Lee Irwin III
2003-08-20  4:11               ` Bill Davidsen
2003-08-20  4:36                 ` William Lee Irwin III
2003-08-20 13:59                 ` Andrew Theurer
2003-08-20 16:18                   ` Bill Davidsen
2003-08-20  2:52         ` Nick Piggin
2003-08-19 19:02     ` Mike Fedyk
2003-08-19 17:51   ` Mike Fedyk
2003-08-20  2:41     ` Nick Piggin
2003-08-20 18:45       ` Mike Fedyk
2003-08-19  4:13 ` Con Kolivas
2003-08-19  4:23   ` Eric St-Laurent
2003-08-19  4:29     ` Con Kolivas
2003-08-19  5:06       ` Eric St-Laurent
2003-08-19  6:18         ` William Lee Irwin III

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=1061266033.2900.43.camel@orbiter \
    --to=ericstl34@sympatico.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=piggin@cyberone.com.au \
    /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