lkml.org 
[lkml]   [2013]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 4/4] sched/nohz_full: give correct cpu load for nohz_full cpu
Date
When a nohz_full cpu in tickless mode, it may update cpu_load in
following chain:
__tick_nohz_full_check
tick_nohz_restart_sched_tick
update_cpu_load_nohz
then it will be set a incorrect cpu_load: 0.
This patch try to fix it and give it the correct cpu_load value.

Signed-off-by: Alex Shi <alex.shi@linaro.org>
---
kernel/sched/proc.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/kernel/sched/proc.c b/kernel/sched/proc.c
index 057bb9b..5058e6a 100644
--- a/kernel/sched/proc.c
+++ b/kernel/sched/proc.c
@@ -477,10 +477,16 @@ 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.
+ * We may has one task and in NO_HZ_FULL, then use normal
+ * cfs load.
+ * Or we were idle, this means load 0, the current load might
+ * be !0 due to remote wakeups and the sort.
*/
- __update_cpu_load(this_rq, 0);
+ if (this_rq->cfs.h_nr_running) {
+ unsigned load = get_rq_runnable_load(this_rq);
+ __update_cpu_load(this_rq, load);
+ } else
+ __update_cpu_load(this_rq, 0);
}
raw_spin_unlock(&this_rq->lock);
}
--
1.8.1.2


\
 
 \ /
  Last update: 2013-11-22 08:01    [W:1.453 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site