From: Valentin Schneider <valentin.schneider@arm.com>
To: Vincent Guittot <vincent.guittot@linaro.org>,
peterz@infradead.org, mingo@kernel.org,
linux-kernel@vger.kernel.org
Cc: Morten.Rasmussen@arm.com
Subject: Re: [PATCH v3 1/3] sched/fair: fix rounding issue for asym packing
Date: Thu, 20 Dec 2018 11:16:30 +0000 [thread overview]
Message-ID: <ec8ccd83-0613-e37a-1a7b-ec680c4c4779@arm.com> (raw)
In-Reply-To: <1545292547-18770-2-git-send-email-vincent.guittot@linaro.org>
On 20/12/2018 07:55, Vincent Guittot wrote:
> When check_asym_packing() is triggered, the imbalance is set to :
> busiest_stat.avg_load * busiest_stat.group_capacity / SCHED_CAPACITY_SCALE
> But busiest_stat.avg_load equals
> sgs->group_load *SCHED_CAPACITY_SCALE / sgs->group_capacity
> These divisions can generate a rounding that will make imbalance slightly
> lower than the weighted load of the cfs_rq.
> But this is enough to skip the rq in find_busiest_queue and prevents asym
> migration to happen.
>
> Directly set imbalance to sgs->group_load to remove the rounding.
^^^^^^^^^^^^^^^
I see where that's coming from, but using 'sgs' here is tad confusing since
'sds->busiest_stat' is what's actually used.
Maybe just something like 'the busiest's sgs->group_load' would be good
enough to make things explicit.
>
> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
> ---
> kernel/sched/fair.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index ca46964..9b31247 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -8476,9 +8476,7 @@ static int check_asym_packing(struct lb_env *env, struct sd_lb_stats *sds)
> if (sched_asym_prefer(busiest_cpu, env->dst_cpu))
> return 0;
>
> - env->imbalance = DIV_ROUND_CLOSEST(
> - sds->busiest_stat.avg_load * sds->busiest_stat.group_capacity,
> - SCHED_CAPACITY_SCALE);
> + env->imbalance = sds->busiest_stat.avg_load;
That should be group_load, not avg_load. With that fixed:
Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>
>
> return 1;
> }
>
next prev parent reply other threads:[~2018-12-20 11:16 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-20 7:55 [PATCH v3 0/3] sched/fair: some fixes for asym_packing Vincent Guittot
2018-12-20 7:55 ` [PATCH v3 1/3] sched/fair: fix rounding issue for asym packing Vincent Guittot
2018-12-20 11:16 ` Valentin Schneider [this message]
2018-12-20 14:22 ` Vincent Guittot
2018-12-20 14:54 ` [PATCH v4 " Vincent Guittot
2018-12-20 7:55 ` [PATCH 2/3] sched/fair: trigger asym_packing during idle load balance Vincent Guittot
2018-12-20 11:19 ` Valentin Schneider
2018-12-20 14:33 ` Vincent Guittot
2018-12-20 16:12 ` Valentin Schneider
2018-12-20 7:55 ` [PATCH 3/3] sched/fair: fix unnecessary increase of balance interval Vincent Guittot
2018-12-20 11:22 ` Valentin Schneider
2018-12-20 14:50 ` Vincent Guittot
2018-12-20 17:24 ` Valentin Schneider
2018-12-21 14:49 ` Vincent Guittot
2018-12-21 17:15 ` Valentin Schneider
2018-12-21 17:41 ` Vincent Guittot
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=ec8ccd83-0613-e37a-1a7b-ec680c4c4779@arm.com \
--to=valentin.schneider@arm.com \
--cc=Morten.Rasmussen@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--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