From: tip-bot for Brendan Jackman <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: mingo@kernel.org, andresoportus@google.com, tglx@linutronix.de,
brendan.jackman@arm.com, dietmar.eggemann@arm.com,
vincent.guittot@linaro.org, torvalds@linux-foundation.org,
morten.rasmussen@arm.com, joelaf@google.com, hpa@zytor.com,
efault@gmx.de, peterz@infradead.org, josef@toxicpanda.com,
linux-kernel@vger.kernel.org
Subject: [tip:sched/core] sched/fair: Sync task util before slow-path wakeup
Date: Tue, 10 Oct 2017 03:58:42 -0700 [thread overview]
Message-ID: <tip-ea16f0ea6c3dc9e1aa083bd3d1792ba02860526e@git.kernel.org> (raw)
In-Reply-To: <20170808095519.10077-1-brendan.jackman@arm.com>
Commit-ID: ea16f0ea6c3dc9e1aa083bd3d1792ba02860526e
Gitweb: https://git.kernel.org/tip/ea16f0ea6c3dc9e1aa083bd3d1792ba02860526e
Author: Brendan Jackman <brendan.jackman@arm.com>
AuthorDate: Thu, 5 Oct 2017 11:55:51 +0100
Committer: Ingo Molnar <mingo@kernel.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@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andres Oportus <andresoportus@google.com>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Joel Fernandes <joelaf@google.com>
Cc: Josef Bacik <josef@toxicpanda.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Morten Rasmussen <morten.rasmussen@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Link: http://lkml.kernel.org/r/20170808095519.10077-1-brendan.jackman@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.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);
prev parent reply other threads:[~2017-10-10 11:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-08 9:55 [PATCH v2] sched/fair: Sync task util before slow-path wakeup Brendan Jackman
2017-09-20 17:17 ` Brendan Jackman
2017-10-10 10:58 ` tip-bot for Brendan Jackman [this message]
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=tip-ea16f0ea6c3dc9e1aa083bd3d1792ba02860526e@git.kernel.org \
--to=tipbot@zytor.com \
--cc=andresoportus@google.com \
--cc=brendan.jackman@arm.com \
--cc=dietmar.eggemann@arm.com \
--cc=efault@gmx.de \
--cc=hpa@zytor.com \
--cc=joelaf@google.com \
--cc=josef@toxicpanda.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=morten.rasmussen@arm.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.