From: William Lee Irwin III <wli@holomorphy.com>
To: Eric St-Laurent <ericstl34@sympatico.ca>
Cc: Con Kolivas <kernel@kolivas.org>, linux-kernel@vger.kernel.org
Subject: Re: scheduler interactivity: timeslice calculation seem wrong
Date: Mon, 18 Aug 2003 23:18:22 -0700 [thread overview]
Message-ID: <20030819061822.GW1715@holomorphy.com> (raw)
In-Reply-To: <1061269559.5853.7.camel@orbiter>
At some point in the past, someone wrote:
>> There's a scheduler implementation dating pre 1970 that does this
>> and I am led to believe someone is working on an implementation for
>> perhaps 2.7
On Tue, Aug 19, 2003 at 01:06:00AM -0400, Eric St-Laurent wrote:
> The first implementation is in 1962 with CTSS if i remember correctly.
> Multics initially had something like that too.
> http://www.multicians.org/mult-sched.html
> Anyway that's pretty standard CS stuff. Multi-level Queues with
> feedback, exponentially longer timeslices with lower priority.
> I was reading this recently, that's why i wondered why linux calculate
> timeslice "inversed" versus what is proposed in theory.
None of the scheduling policies described there are multi-level queue
-based policies. The bottom-level scheduler was FB until ca. 1976,
when a deadline-based scheduling policy was adopted.
Multilevel queue -based policies segregate tasks into service levels
by the amount of runtime accumulated without blocking (i.e. continual
spinning interrupted only by the scheduler yanking the thing off the
cpu to run something else because it's run too long) and do some other
kind of scheduling within the levels, typically RR with quanta
determined by the level. Various hacks to elevate or lower the service
level with different kinds of I/O or device access were typically used
as interactivity heuristics and were used in the 1967-1975 Multics FB
scheduling policies as described in that webpage.
The deadline scheduler is very different in its mechanics and very
flexible; it's almost impossible to say anything about it without
knowing how the deadlines were assigned. FB is actually very well-
understood, but trivially DoS'able in real-life environments, as
looping coprocesses will monopolize the cpu. The fact device access
and other similar heuristics were required to make it behave well
in interactive environments should be a big hint that the FB design
is fundamentally inadequate.
One obviously nice thing about deadline scheduling is that it's trivial
to prevent starvation: merely assign nonzero offsets from the present
to all tasks, and the ``finger'' pointing at the current task to run
is guaranteed to advance and so cover every queued task. In essence,
deadline scheduling controls how often tasks get to run directly as
opposed to remaining at the mercy of wakeups.
The description of the Multics algorithm implies that at each wakeup
one of two quanta was assigned to the task when it got scheduled, that
one of two workclass-specific virtual deadlines was assigned, and that
the only attempt to account for service time was a distinction between
the first time the task was run and all other times, where the first
time it was run got quantum Q1 and deadline R1 and the rest quantum Q2
and deadline R2, where presumably Q1 < Q2 and R1 < R2. This obviously
does not fully exploit the expressiveness of the deadline design as
one can easily conceive of service time and priority (nice number)
dependent deadline/quanta assignments that make various kinds of sense.
-- wli
prev parent reply other threads:[~2003-08-19 6:17 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
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 [this message]
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=20030819061822.GW1715@holomorphy.com \
--to=wli@holomorphy.com \
--cc=ericstl34@sympatico.ca \
--cc=kernel@kolivas.org \
--cc=linux-kernel@vger.kernel.org \
/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