[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1385102235-25664-5-git-send-email-alex.shi@linaro.org>
Date: Fri, 22 Nov 2013 14:37:15 +0800
From: Alex Shi <alex.shi@...aro.org>
To: mingo@...hat.com, peterz@...radead.org, morten.rasmussen@....com,
vincent.guittot@...aro.org, daniel.lezcano@...aro.org,
fweisbec@...il.com, linux@....linux.org.uk, tony.luck@...el.com,
fenghua.yu@...el.com, tglx@...utronix.de,
akpm@...ux-foundation.org, arjan@...ux.intel.com, pjt@...gle.com,
fengguang.wu@...el.com
Cc: james.hogan@...tec.com, alex.shi@...aro.org, jason.low2@...com,
gregkh@...uxfoundation.org, hanjun.guo@...aro.org,
linux-kernel@...r.kernel.org
Subject: [RFC PATCH 4/4] sched/nohz_full: give correct cpu load for nohz_full cpu
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@...aro.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists