diff options
author | Byungchul Park <byungchul.park@lge.com> | 2015-11-10 09:36:02 +0900 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-11-23 09:37:53 +0100 |
commit | 525705d15e63b7455977408e4601e76e6bc41524 (patch) | |
tree | 9e201e3afd08f1874f79c6c00b227fc360e7844a /kernel/sched | |
parent | 59543275488d18d878cd2ab2b1072efc1e9ac1c4 (diff) | |
download | linux-525705d15e63b7455977408e4601e76e6bc41524.tar.bz2 |
sched/fair: Consider missed ticks in NOHZ_FULL in update_cpu_load_nohz()
Usually the tick can be stopped for an idle CPU in NOHZ. However in NOHZ_FULL
mode, a non-idle CPU's tick can also be stopped. However, update_cpu_load_nohz()
does not consider the case a non-idle CPU's tick has been stopped at all.
This patch makes the update_cpu_load_nohz() know if the calling path comes
from NOHZ_FULL or idle NOHZ.
Signed-off-by: Byungchul Park <byungchul.park@lge.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1447115762-19734-3-git-send-email-byungchul.park@lge.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched')
-rw-r--r-- | kernel/sched/fair.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 404006ae1ac9..309b1d551f25 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4397,10 +4397,11 @@ static void update_idle_cpu_load(struct rq *this_rq) /* * Called from tick_nohz_idle_exit() -- try and fix up the ticks we missed. */ -void update_cpu_load_nohz(void) +void update_cpu_load_nohz(int active) { struct rq *this_rq = this_rq(); unsigned long curr_jiffies = READ_ONCE(jiffies); + unsigned long load = active ? weighted_cpuload(cpu_of(this_rq)) : 0; unsigned long pending_updates; if (curr_jiffies == this_rq->last_load_update_tick) @@ -4411,10 +4412,11 @@ void update_cpu_load_nohz(void) if (pending_updates) { this_rq->last_load_update_tick = curr_jiffies; /* - * We were idle, this means load 0, the current load might be - * !0 due to remote wakeups and the sort. + * In the regular NOHZ case, we were idle, this means load 0. + * In the NOHZ_FULL case, we were non-idle, we should consider + * its weighted load. */ - __update_cpu_load(this_rq, 0, pending_updates, 0); + __update_cpu_load(this_rq, load, pending_updates, active); } raw_spin_unlock(&this_rq->lock); } |