[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20160921133813.31976-3-matt@codeblueprint.co.uk>
Date: Wed, 21 Sep 2016 14:38:08 +0100
From: Matt Fleming <matt@...eblueprint.co.uk>
To: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>
Cc: Byungchul Park <byungchul.park@....com>,
Frederic Weisbecker <fweisbec@...il.com>,
Luca Abeni <luca.abeni@...tn.it>,
Rik van Riel <riel@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Wanpeng Li <wanpeng.li@...mail.com>,
Yuyang Du <yuyang.du@...el.com>,
Petr Mladek <pmladek@...e.com>, Jan Kara <jack@...e.cz>,
Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
linux-kernel@...r.kernel.org,
Mel Gorman <mgorman@...hsingularity.net>,
Mike Galbraith <umgwanakikbuti@...il.com>,
Matt Fleming <matt@...eblueprint.co.uk>
Subject: [PATCH v2 2/7] sched/fair: Update rq clock before waking up new task
When initialising an entity's util and load averages we need an up to
date runqueue clock.
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Ingo Molnar <mingo@...nel.org>
Cc: Mel Gorman <mgorman@...hsingularity.net>
Cc: Mike Galbraith <umgwanakikbuti@...il.com>
Signed-off-by: Matt Fleming <matt@...eblueprint.co.uk>
---
kernel/sched/fair.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index ab1cf3866a5b..7f8a61e97599 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -731,7 +731,10 @@ void post_init_entity_util_avg(struct sched_entity *se)
struct cfs_rq *cfs_rq = cfs_rq_of(se);
struct sched_avg *sa = &se->avg;
long cap = (long)(SCHED_CAPACITY_SCALE - cfs_rq->avg.util_avg) / 2;
- u64 now = cfs_rq_clock_task(cfs_rq);
+ u64 now;
+
+ update_rq_clock(rq_of(cfs_rq));
+ now = cfs_rq_clock_task(cfs_rq);
if (cap > 0) {
if (cfs_rq->avg.util_avg != 0) {
--
2.9.3
Powered by blists - more mailing lists