From: Vincent Guittot <vincent.guittot@linaro.org>
To: peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org
Cc: valentin.schneider@arm.com, Morten.Rasmussen@arm.com,
Vincent Guittot <vincent.guittot@linaro.org>
Subject: [PATCH v3 1/3] sched/fair: fix rounding issue for asym packing
Date: Thu, 20 Dec 2018 08:55:45 +0100 [thread overview]
Message-ID: <1545292547-18770-2-git-send-email-vincent.guittot@linaro.org> (raw)
In-Reply-To: <1545292547-18770-1-git-send-email-vincent.guittot@linaro.org>
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.
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;
return 1;
}
--
2.7.4
next prev parent reply other threads:[~2018-12-20 7:56 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 ` Vincent Guittot [this message]
2018-12-20 11:16 ` [PATCH v3 1/3] sched/fair: fix rounding issue for asym packing Valentin Schneider
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=1545292547-18770-2-git-send-email-vincent.guittot@linaro.org \
--to=vincent.guittot@linaro.org \
--cc=Morten.Rasmussen@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=valentin.schneider@arm.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;
as well as URLs for NNTP newsgroup(s).