From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: J K Rai <jk.anurag@yahoo.com>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>
Subject: Re: Time slice for SCHED_BATCH ( CFS)
Date: Wed, 11 Feb 2009 14:02:30 +0100 [thread overview]
Message-ID: <1234357350.23438.149.camel@twins> (raw)
In-Reply-To: <303179.28635.qm@web94707.mail.in2.yahoo.com>
On Wed, 2009-02-11 at 17:58 +0530, J K Rai wrote:
> Can we say that given n cpus and m processes the time-slice will
> remain constant under SCHED_BATCH or so?
Only if those processes remain running, if they get blocked for whatever
reason it'll change.
> Can we form some kind of relationship?
Sure,
latency := 20ms * (1 + log2(nr_cpus))
min_granularity := 4ms * (1 + log2(nr_cpus))
nr_latency := floor(latency / min_granularity)
latency ; nr_running <= nr_latency
period = {
nr_running * min_granularity ; nr_running > nr_latency
slice = task_weight * period / runqueue_weight
as you can see, its a function of the number of cpus, as well as all
other running tasks on a particular cpu.
Load-balancing of course makes this an even more interesting thing.
next prev parent reply other threads:[~2009-02-11 13:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <315626.71453.qm@web94713.mail.in2.yahoo.com>
[not found] ` <20090211102024.GI20518@elte.hu>
[not found] ` <1234348436.23438.119.camel@twins>
[not found] ` <303179.28635.qm@web94707.mail.in2.yahoo.com>
2009-02-11 12:40 ` Time slice for SCHED_BATCH ( CFS) Ingo Molnar
2009-02-11 13:02 ` Peter Zijlstra [this message]
[not found] ` <441046.97200.qm@web94712.mail.in2.yahoo.com>
2009-02-12 9:13 ` Peter Zijlstra
[not found] ` <466094.58460.qm@web94704.mail.in2.yahoo.com>
2009-02-12 11:04 ` Peter Zijlstra
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=1234357350.23438.149.camel@twins \
--to=a.p.zijlstra@chello.nl \
--cc=jk.anurag@yahoo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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