From: Peter Williams <pwil3058@bigpond.net.au>
To: Ingo Molnar <mingo@elte.hu>
Cc: William Lee Irwin III <wli@holomorphy.com>,
linux-kernel@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
Con Kolivas <kernel@kolivas.org>, Nick Piggin <npiggin@suse.de>,
Mike Galbraith <efault@gmx.de>,
Arjan van de Ven <arjan@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>,
caglar@pardus.org.tr, Willy Tarreau <w@1wt.eu>,
Gene Heskett <gene.heskett@gmail.com>
Subject: Re: [patch] CFS scheduler, v3
Date: Sat, 21 Apr 2007 20:37:06 +1000 [thread overview]
Message-ID: <4629E952.4000508@bigpond.net.au> (raw)
In-Reply-To: <20070421075401.GA23410@elte.hu>
Ingo Molnar wrote:
> * Peter Williams <pwil3058@bigpond.net.au> wrote:
>
>> I retract this suggestion as it's a very bad idea. It introduces the
>> possibility of starvation via the poor sods at the bottom of the queue
>> having their "on CPU" forever postponed and we all know that even the
>> smallest possibility of starvation will eventually cause problems.
>>
>> I think there should be a rule: Once a task is on the queue its "on
>> CPU" time is immutable.
>
> Yeah, fully agreed. Currently i'm using the simple method of
> p->nice_offset, which plainly just moves the per nice level areas of the
> tree far enough apart (by a constant offset) so that lower nice levels
> rarely interact with higher nice levels. Lower nice levels never truly
> starve because rq->fair_clock increases deterministically and currently
> the fair_key values are indeed 'immutable' as you suggest.
>
> In practice they can starve a bit when one renices thousands of tasks,
> so i was thinking about the following special-case: to at least make
> them easily killable: if a nice 0 task sends a SIGKILL to a nice 19 task
> then we could 'share' its p->wait_runtime with that nice 19 task and
> copy the signal sender's nice_offset. This would in essence pass the
> right to execute over to the killed task, so that it can tear itself
> down.
>
> This cannot be used to gain an 'unfair advantage' because the signal
> sender spends its own 'right to execute on the CPU', and because the
> target task cannot execute any user code anymore when it gets a SIGKILL.
>
> In any case, it is clear that rq->raw_cpu_load should be used instead of
> rq->nr_running, when calculating the fair clock, but i begin to like the
> nice_offset solution too in addition of this: it's effective in practice
> and starvation-free in theory, and most importantly, it's very simple.
> We could even make the nice offset granularity tunable, just in case
> anyone wants to weaken (or strengthen) the effectivity of nice levels.
> What do you think, can you see any obvious (or less obvious)
> showstoppers with this approach?
I haven't had a close look at it but from the above description it
sounds an order of magnitude more complex than I thought it would be.
The idea of different nice levels sounds like a recipe for starvation to
me (if it works the way it sounds like it works).
I guess I'll have to spend more time reading the code because I don't
seem to be able to make sense of the above description in any way that
doesn't say "starvation here we come".
Peter
--
Peter Williams pwil3058@bigpond.net.au
"Learning, n. The kind of ignorance distinguishing the studious."
-- Ambrose Bierce
next prev parent reply other threads:[~2007-04-21 10:37 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-18 17:50 [patch] CFS scheduler, v3 Ingo Molnar
2007-04-18 21:26 ` William Lee Irwin III
2007-04-18 21:33 ` Ingo Molnar
2007-04-20 19:24 ` Christoph Lameter
2007-04-20 19:26 ` Siddha, Suresh B
2007-04-20 19:29 ` William Lee Irwin III
2007-04-20 19:33 ` Christoph Lameter
2007-04-20 19:38 ` William Lee Irwin III
2007-04-20 19:44 ` Christoph Lameter
2007-04-20 20:03 ` William Lee Irwin III
2007-04-20 20:11 ` Siddha, Suresh B
2007-04-24 17:39 ` Christoph Lameter
2007-04-24 17:42 ` Siddha, Suresh B
2007-04-24 17:47 ` Christoph Lameter
2007-04-24 17:50 ` Siddha, Suresh B
2007-04-24 17:55 ` Christoph Lameter
2007-04-24 18:06 ` Siddha, Suresh B
2007-04-20 0:10 ` Peter Williams
2007-04-20 4:48 ` Willy Tarreau
2007-04-20 6:02 ` Peter Williams
2007-04-20 6:21 ` Peter Williams
2007-04-20 7:26 ` Willy Tarreau
2007-04-20 6:46 ` Ingo Molnar
2007-04-20 7:32 ` Peter Williams
2007-04-20 12:28 ` Peter Williams
2007-04-21 8:07 ` Peter Williams
2007-04-20 13:15 ` William Lee Irwin III
2007-04-21 0:23 ` Peter Williams
2007-04-21 5:07 ` William Lee Irwin III
2007-04-21 5:38 ` Peter Williams
2007-04-21 7:32 ` Peter Williams
2007-04-21 7:54 ` Ingo Molnar
2007-04-21 8:33 ` William Lee Irwin III
2007-04-21 8:57 ` Ingo Molnar
2007-04-21 16:23 ` William Lee Irwin III
2007-04-21 10:37 ` Peter Williams [this message]
2007-04-21 12:21 ` Peter Williams
2007-04-20 14:21 ` Peter Williams
2007-04-20 14:33 ` Ingo Molnar
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=4629E952.4000508@bigpond.net.au \
--to=pwil3058@bigpond.net.au \
--cc=akpm@linux-foundation.org \
--cc=arjan@infradead.org \
--cc=caglar@pardus.org.tr \
--cc=efault@gmx.de \
--cc=gene.heskett@gmail.com \
--cc=kernel@kolivas.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=npiggin@suse.de \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=w@1wt.eu \
--cc=wli@holomorphy.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