lkml.org 
[lkml]   [2013]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 3/3] nohz_full: update cpu load fix in nohz_full
Date
We are not always 0 when update nohz cpu load, after nohz_full enabled.
But current code still treat the cpu as idle. that is incorrect.
Fix it to use correct cpu_load.

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

diff --git a/kernel/sched/proc.c b/kernel/sched/proc.c
index 16f5a30..f1441f0 100644
--- a/kernel/sched/proc.c
+++ b/kernel/sched/proc.c
@@ -568,8 +568,14 @@ void update_cpu_load_nohz(void)
/*
* We were idle, this means load 0, the current load might be
* !0 due to remote wakeups and the sort.
+ * or we may has only one task and in NO_HZ_FULL, then still use
+ * normal cpu load.
*/
- __update_cpu_load(this_rq, 0, pending_updates);
+ if (this_rq->cfs.h_nr_running) {
+ unsigned load = get_rq_runnable_load(this_rq);
+ __update_cpu_load(this_rq, load, pending_updates);
+ } else
+ __update_cpu_load(this_rq, 0, pending_updates);
}
raw_spin_unlock(&this_rq->lock);
}
--
1.8.1.2


\
 
 \ /
  Last update: 2013-12-03 14:01    [W:0.094 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site