From: Peter Zijlstra <peterz@infradead.org>
To: Byungchul Park <byungchul.park@lge.com>
Cc: mingo@kernel.org, linux-kernel@vger.kernel.org,
fweisbec@gmail.com, tglx@linutronix.de
Subject: Re: [PATCH v4 1/2] sched: make __update_cpu_load() handle active tickless case
Date: Tue, 20 Oct 2015 11:48:48 +0200 [thread overview]
Message-ID: <20151020094848.GZ17308@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20151020004932.GB28741@byungchulpark-X58A-UD3R>
On Tue, Oct 20, 2015 at 09:49:32AM +0900, Byungchul Park wrote:
> > > = A^i * cpu_load(n-i) + (A^(i-1) + A^(i-2) + ... + 1) * B
> > > , where i = pending_updates - 1
> >
> > You missed an opportunity here, if you take i==n you avoid the need for
> > i entirely.
>
> i don't think so. as i said, _n_ is the current tick -1 and _i_ is
> pending_updates - 1. we cannot take i == n, but should keep (n-i).
Just think relative; it doesn't matter when in time we do this.
So 0 to n is identical to any other interval.
> > > = A^i * cpu_load(n-i) + B * (A^i - 1) / (A - 1)
> > > , by geometric series formula for sum
> >
> > That's wrong; the limited geometric series expands to:
>
> NO, that's not wrong. it doesn't matter at all.
>
> a * (1 - r^n) / (1 - r)
> = a * (-1)(r^n - 1) / (-1)(r - 1)
> = a * (r^n - 1) / (r - 1)
>
> i mean these two are exactly same.
Ah indeed! Sorry for that. I clearly didn't think beyond the series
expansion I found.
> > I've rewritten the things a little; does this look good to you?
>
> however, your expressions and descriptions below look better than me,
> except some logical errors. could you keep my logical flow unchagned?
> > + * load[i]_n = (1 - 1/2^i) * load[i]_n-1 + (1/2^i) * load_n-1
> > + * = A * load[i]_n-1 + B ; A := (1 - 1/2^i), B := (1/2^i) * load
> > + * = A * (A * load[i]_n-2 + B) + B
> > + * = A * (A * (A * load[i]_n-3 + B) + B) + B
> > + * = A^3 * load[i]_n-3 + (A^2 + A + 1) * B
> > + * = A^n * load[i]_0 + (A^(n-1) + A^(n-2) + ... + 1) * B
> > + * = A^n * load[i]_0 + ((1 - A^n) / (1 - A)) * B
> > + * = (1 - 1/2^i)^n * (load[i]_0 - load) + load
That is the same logic, right?
Please be more specific as to what you'd like restored.
next prev parent reply other threads:[~2015-10-20 9:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-14 9:47 [PATCH v4 0/2] sched: consider missed ticks when updating cpu load byungchul.park
2015-10-14 9:47 ` [PATCH v4 1/2] sched: make __update_cpu_load() handle active tickless case byungchul.park
2015-10-19 13:16 ` Peter Zijlstra
2015-10-20 0:49 ` Byungchul Park
2015-10-20 9:48 ` Peter Zijlstra [this message]
2015-10-22 10:28 ` Byungchul Park
2015-10-22 11:05 ` Peter Zijlstra
2015-11-23 16:18 ` [tip:sched/core] sched/fair: Prepare __update_cpu_load() to handle active tickless tip-bot for Byungchul Park
2015-10-14 9:47 ` [PATCH v4 2/2] sched: consider missed ticks in full NOHZ byungchul.park
2015-10-22 16:20 ` Frederic Weisbecker
2015-11-02 16:10 ` Peter Zijlstra
2015-11-09 2:36 ` Byungchul Park
2015-11-09 10:36 ` Peter Zijlstra
2015-11-09 11:16 ` Byungchul Park
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=20151020094848.GZ17308@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=byungchul.park@lge.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
/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