From: Ingo Molnar <mingo@elte.hu>
To: William Lee Irwin III <wli@holomorphy.com>
Cc: Srivatsa Vaddagiri <vatsa@in.ibm.com>,
efault@gmx.de, tingy@cs.umass.edu, linux-kernel@vger.kernel.org
Subject: Re: fair clock use in CFS
Date: Mon, 14 May 2007 13:50:49 +0200 [thread overview]
Message-ID: <20070514115049.GA28721@elte.hu> (raw)
In-Reply-To: <20070514110500.GV19966@holomorphy.com>
* William Lee Irwin III <wli@holomorphy.com> wrote:
> On Mon, May 14, 2007 at 12:31:20PM +0200, Ingo Molnar wrote:
> > please clarify - exactly what is a mistake? Thanks,
>
> The variability in ->fair_clock advancement rate was the mistake, at
> least according to my way of thinking. [...]
you are quite wrong. Lets consider the following example:
we have 10 tasks running (all at nice 0). The current task spends 20
msecs on the CPU and a new task is picked. How much CPU time did that
waiting task get entitled to during its 20 msecs wait? If fair_clock was
constant as you suggest then we'd give it 20 msecs - but its true 'fair
expectation' of CPU time was only 20/10 == 2 msecs!
So a 'constant' fair_clock would turn the whole equilibrium upside down
(it would inflate p->wait_runtime values and the global sum would not be
roughly constant anymore but would run up very fast), especially during
fluctuating loads.
the fair_clock is the fundamental expression of "fair CPU timeline", and
task's expected runtime is always measured by that, not by the real
clock. The only time when we measure the true time is when a _single_
task runs on the CPU - but in that case the task truly spent a small
amount of time on the CPU, exclusively. See the exec_time calculations
in kernel/sched_fair.c.
Ingo
next prev parent reply other threads:[~2007-05-14 11:59 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-14 8:33 fair clock use in CFS Srivatsa Vaddagiri
2007-05-14 10:29 ` William Lee Irwin III
2007-05-14 10:31 ` Ingo Molnar
2007-05-14 11:05 ` William Lee Irwin III
2007-05-14 11:22 ` Srivatsa Vaddagiri
2007-05-14 11:20 ` William Lee Irwin III
2007-05-14 12:04 ` Ingo Molnar
2007-05-14 23:57 ` William Lee Irwin III
2007-05-14 20:20 ` Ting Yang
2007-05-14 11:50 ` Ingo Molnar [this message]
2007-05-14 14:31 ` Daniel Hazelton
2007-05-14 15:02 ` Srivatsa Vaddagiri
2007-05-14 15:08 ` Ingo Molnar
2007-05-15 2:59 ` David Schwartz
2007-05-14 21:24 ` Ting Yang
2007-05-15 0:57 ` Ting Yang
2007-05-14 23:23 ` William Lee Irwin III
2007-05-14 11:10 ` Ingo Molnar
2007-05-14 13:04 ` Srivatsa Vaddagiri
2007-05-14 13:15 ` Ingo Molnar
-- strict thread matches above, loose matches on Subject: below --
2007-05-14 15:02 Al Boldi
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=20070514115049.GA28721@elte.hu \
--to=mingo@elte.hu \
--cc=efault@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=tingy@cs.umass.edu \
--cc=vatsa@in.ibm.com \
--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