From: Peter Zijlstra <peterz@infradead.org>
To: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Vincent Donnefort <vincent.donnefort@arm.com>,
mingo@readhat.com, vincent.guittot@linaro.org,
linux-kernel@vger.kernel.org, patrick.bellasi@matbug.net,
valentin.schneider@arm.com
Subject: Re: [PATCH v2] sched/pelt: Fix task util_est update filtering
Date: Mon, 1 Mar 2021 18:21:23 +0100 [thread overview]
Message-ID: <YD0ik65KwwU5R4Rv@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <b1471e3a-e8c5-3ab4-5db4-0084612ade55@arm.com>
On Mon, Mar 01, 2021 at 05:34:09PM +0100, Dietmar Eggemann wrote:
> On 26/02/2021 09:41, Peter Zijlstra wrote:
> > On Thu, Feb 25, 2021 at 04:58:20PM +0000, Vincent Donnefort wrote:
> >> +#define UTIL_EST_MARGIN (SCHED_CAPACITY_SCALE / 100)
> >> +
> >> /*
> >> - * Check if a (signed) value is within a specified (unsigned) margin,
> >> + * Check if a (signed) value is within the (unsigned) util_est margin,
> >> * based on the observation that:
> >> *
> >> * abs(x) < y := (unsigned)(x + y - 1) < (2 * y - 1)
> >> *
> >> - * NOTE: this only works when value + maring < INT_MAX.
> >> + * NOTE: this only works when value + UTIL_EST_MARGIN < INT_MAX.
> >> */
> >> -static inline bool within_margin(int value, int margin)
> >> +static inline bool util_est_within_margin(int value)
> >> {
> >> - return ((unsigned int)(value + margin - 1) < (2 * margin - 1));
> >> + return ((unsigned int)(value + UTIL_EST_MARGIN - 1) <
> >> + (2 * UTIL_EST_MARGIN - 1));
> >> }
> >
> >> - if (within_margin(last_ewma_diff, (SCHED_CAPACITY_SCALE / 100)))
> >> + if (util_est_within_margin(last_ewma_diff)) {
> >
> > What was the purpose of this change? What was a generic helper is now
> > super specific.
>
> I guess because it was only ever used in util_est for last_ewma_diff.
>
> It's now used for last_ewma_diff and last_enqueued_diff, still only for
> util_est though and both times with the same margin
> (SCHED_CAPACITY_SCALE / 100)).
>
> Vincent D. should be back on Wed from hols.
Fair enough; I've un-done it but kept the rest of the patch.
next prev parent reply other threads:[~2021-03-01 21:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-25 16:58 [PATCH v2] sched/pelt: Fix task util_est update filtering Vincent Donnefort
2021-02-26 7:22 ` Vincent Guittot
2021-02-26 8:41 ` Peter Zijlstra
2021-03-01 16:34 ` Dietmar Eggemann
2021-03-01 17:21 ` Peter Zijlstra [this message]
2021-03-03 10:06 ` Vincent Donnefort
2021-03-02 9:01 ` [tip: sched/core] " tip-bot2 for Vincent Donnefort
2021-03-03 9:49 ` tip-bot2 for Vincent Donnefort
2021-03-06 11:42 ` tip-bot2 for Vincent Donnefort
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=YD0ik65KwwU5R4Rv@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=dietmar.eggemann@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@readhat.com \
--cc=patrick.bellasi@matbug.net \
--cc=valentin.schneider@arm.com \
--cc=vincent.donnefort@arm.com \
--cc=vincent.guittot@linaro.org \
/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;
as well as URLs for NNTP newsgroup(s).