From: Ingo Molnar <mingo@elte.hu>
To: David Schwartz <davids@webmaster.com>
Cc: mgix@mgix.com, Robert Love <rml@tech9.net>,
<root@chaos.analogic.com>,
Chris Friesen <Chris.Friesen@mail.elte.hu>,
<cfriesen@nortelnetworks.com>, <linux-kernel@vger.kernel.org>
Subject: RE: Question about sched_yield()
Date: Wed, 19 Jun 2002 00:28:27 +0200 (CEST) [thread overview]
Message-ID: <Pine.LNX.4.44.0206190018310.23460-100000@e2> (raw)
In-Reply-To: <20020618204237.AAA5802@shell.webmaster.com@whenever>
On Tue, 18 Jun 2002, David Schwartz wrote:
> Exactly. This is the UNIX tradition of static and dynamic
> priorities. The more polite you are about yielding the CPU when you
> don't need it, the more claim you have to getting it when you do need
> it.
firstly, the thing that defines the scheduler's implementation details is
not tradition but actual, hard, verifiable use. If you've ever seen
sched_yield() code under Linux then you'll quickly realize that it's
mainly used as a "oh damn, i cannot continue now, i have no proper kernel
object to sleep on, lets busy-wait" kind of mechanizm. (Which, by the way,
is as far from polite as it gets.)
secondly, i'd like to ask everyone arguing one way or other, and this
means you and Robert and everyone else as well, to actually read and think
about the fix i did.
The new implementation of sched_yield() is *not* throwing away your
timeslices immediately. In fact it first tries it the 'polite' way to get
some progress by gradually decreasing its priority - *IF* that fails (and
it has to fail and keep looping for at least ~10 times if there are
default priorities) then it will start dropping away timeslices - one by
one. That gives another 20 opportunities for the task to actually get some
work done. Even after this we still let the task run one more jiffy.
*THEN* only is the task pushed back into the expired array.
so the tests quoted here were the extreme example: a task did nothing but
sched_yield(). And the modified scheduler did a good job of supressing
this process, if there was other, non-sched_yield() work around. A
database process with a casual sched_yield() call should not see much
effect.
Ingo
next prev parent reply other threads:[~2002-06-18 22:31 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-15 22:15 mgix
2002-06-16 14:43 ` [patch] " Ingo Molnar
2002-06-18 0:46 ` David Schwartz
2002-06-18 0:55 ` Robert Love
2002-06-18 1:51 ` mgix
2002-06-18 3:18 ` David Schwartz
2002-06-18 9:36 ` David Schwartz
2002-06-18 16:58 ` Chris Friesen
2002-06-18 17:12 ` Richard B. Johnson
2002-06-18 17:19 ` mgix
2002-06-18 18:01 ` David Schwartz
2002-06-18 18:05 ` mgix
2002-06-18 19:11 ` David Schwartz
2002-06-18 16:58 ` Rob Landley
2002-06-18 19:25 ` Robert Love
2002-06-18 19:53 ` David Schwartz
2002-06-18 20:12 ` mgix
2002-06-18 20:42 ` David Schwartz
2002-06-18 20:47 ` mgix
2002-06-18 22:00 ` David Schwartz
2002-06-18 22:28 ` Ingo Molnar [this message]
2002-06-18 20:08 ` Richard B. Johnson
2002-06-19 11:10 ` Bill Davidsen
2002-06-19 12:04 ` Ingo Molnar
2002-06-18 22:43 ` Olivier Galibert
2002-06-18 18:21 ` Richard B. Johnson
2002-06-18 17:13 ` Robert Love
2002-06-18 18:00 ` David Schwartz
2002-06-18 22:45 ` Stevie O
2002-06-19 2:11 ` David Schwartz
2002-06-19 2:52 ` Stevie O
2002-06-20 20:31 ` David Schwartz
2002-06-18 17:23 ` Rik van Riel
2002-06-18 17:50 ` Chris Friesen
2002-06-18 1:41 ` mgix
2002-06-18 3:21 ` David Schwartz
2002-06-18 3:52 ` mgix
2002-06-18 4:55 ` Ingo Molnar
2002-06-19 11:24 ` Bill Davidsen
2002-06-19 11:47 ` scheduler timeslice distribution, threads, processes. [was: Re: Question about sched_yield()] Ingo Molnar
2002-06-18 18:56 ` Question about sched_yield() Rusty Russell
2002-06-18 19:12 ` David Schwartz
2002-06-18 20:19 ` Rusty Russell
2002-06-18 20:40 ` David Schwartz
2002-06-18 20:42 ` mgix
2002-06-18 22:03 ` David Schwartz
2002-06-18 22:36 ` Ingo Molnar
2002-06-19 11:29 ` Bill Davidsen
2002-06-19 14:03 ` Rusty Russell
2002-06-19 22:25 ` Bill Davidsen
2002-06-19 22:37 ` Ingo Molnar
2002-06-19 2:10 ` jw schultz
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=Pine.LNX.4.44.0206190018310.23460-100000@e2 \
--to=mingo@elte.hu \
--cc=Chris.Friesen@mail.elte.hu \
--cc=cfriesen@nortelnetworks.com \
--cc=davids@webmaster.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgix@mgix.com \
--cc=rml@tech9.net \
--cc=root@chaos.analogic.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
all inboxes | Powered by JetHome®