[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Tue, 10 Oct 2017 03:58:42 -0700
From: tip-bot for Brendan Jackman <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: mingo@...nel.org, andresoportus@...gle.com, tglx@...utronix.de,
brendan.jackman@....com, dietmar.eggemann@....com,
vincent.guittot@...aro.org, torvalds@...ux-foundation.org,
morten.rasmussen@....com, joelaf@...gle.com, hpa@...or.com,
efault@....de, peterz@...radead.org, josef@...icpanda.com,
linux-kernel@...r.kernel.org
Subject: [tip:sched/core] sched/fair: Sync task util before slow-path wakeup
Commit-ID: ea16f0ea6c3dc9e1aa083bd3d1792ba02860526e
Gitweb: https://git.kernel.org/tip/ea16f0ea6c3dc9e1aa083bd3d1792ba02860526e
Author: Brendan Jackman <brendan.jackman@....com>
AuthorDate: Thu, 5 Oct 2017 11:55:51 +0100
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Tue, 10 Oct 2017 11:45:31 +0200
sched/fair: Sync task util before slow-path wakeup
We use task_util() in find_idlest_group() via capacity_spare_wake().
This task_util() updated in wake_cap(). However wake_cap() is not the
only reason for ending up in find_idlest_group() - we could have been sent
there by wake_wide(). So explicitly sync the task util with prev_cpu
when we are about to head to find_idlest_group().
We could simply do this at the beginning of
select_task_rq_fair() (i.e. irrespective of whether we're heading to
select_idle_sibling() or find_idlest_group() & co), but I didn't want to
slow down the select_idle_sibling() path more than necessary.
Don't do this during fork balancing, we won't need the task_util and
we'd just clobber the last_update_time, which is supposed to be 0.
Signed-off-by: Brendan Jackman <brendan.jackman@....com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Cc: Andres Oportus <andresoportus@...gle.com>
Cc: Dietmar Eggemann <dietmar.eggemann@....com>
Cc: Joel Fernandes <joelaf@...gle.com>
Cc: Josef Bacik <josef@...icpanda.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Mike Galbraith <efault@....de>
Cc: Morten Rasmussen <morten.rasmussen@....com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Vincent Guittot <vincent.guittot@...aro.org>
Link: http://lkml.kernel.org/r/20170808095519.10077-1-brendan.jackman@arm.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
kernel/sched/fair.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index cc0bfb0..c04a425 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6263,8 +6263,17 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_f
new_cpu = cpu;
}
+ if (sd && !(sd_flag & SD_BALANCE_FORK)) {
+ /*
+ * We're going to need the task's util for capacity_spare_wake
+ * in find_idlest_group. Sync it up to prev_cpu's
+ * last_update_time.
+ */
+ sync_entity_load_avg(&p->se);
+ }
+
if (!sd) {
- pick_cpu:
+pick_cpu:
if (sd_flag & SD_BALANCE_WAKE) /* XXX always ? */
new_cpu = select_idle_sibling(p, prev_cpu, new_cpu);
Powered by blists - more mailing lists