diff options
| author | Lianwei Wang <a22439@motorola.com> | 2014-12-05 15:29:09 -0800 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2019-05-02 14:30:27 +0200 |
| commit | 23d0d66e029e827b33a899b79aa446aaff0ca9fb (patch) | |
| tree | c17c715b4071945d4a6cc4ed74a16013f273cb75 /kernel/time | |
| parent | 1c96da9a7439f87cf2793a60b0a80c488c687cae (diff) | |
tick: don't update idle time if cpu offline
Propagate from (CR).
An offline cpu still has ts->idle_active == 1, that cause
off time is counted as idle time, and hence cause cpu load
calculated wrongly.
Check the cpu online status before updating the idle time to
fix it.
Change-Id: I8c3213105601efca037eb23ad724811b5f46d437
Signed-off-by: Lianwei Wang <a22439@motorola.com>
Reviewed-on: http://gerrit.mot.com/727323
SLTApproved: Slta Waiver <sltawvr@motorola.com>
SME-Granted: SME Approvals Granted
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Igor Kovalenko <igork@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
Diffstat (limited to 'kernel/time')
| -rw-r--r-- | kernel/time/tick-sched.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 6368929f9..dd34b75f0 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -436,7 +436,7 @@ update_ts_time_stats(int cpu, struct tick_sched *ts, ktime_t now, u64 *last_upda { ktime_t delta; - if (ts->idle_active) { + if (ts->idle_active && cpu_online(cpu)) { delta = ktime_sub(now, ts->idle_entrytime); if (nr_iowait_cpu(cpu) > 0) ts->iowait_sleeptime = ktime_add(ts->iowait_sleeptime, delta); @@ -504,7 +504,7 @@ u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time) update_ts_time_stats(cpu, ts, now, last_update_time); idle = ts->idle_sleeptime; } else { - if (ts->idle_active && !nr_iowait_cpu(cpu)) { + if (ts->idle_active && !nr_iowait_cpu(cpu) && cpu_online(cpu)) { ktime_t delta = ktime_sub(now, ts->idle_entrytime); idle = ktime_add(ts->idle_sleeptime, delta); @@ -545,7 +545,7 @@ u64 get_cpu_iowait_time_us(int cpu, u64 *last_update_time) update_ts_time_stats(cpu, ts, now, last_update_time); iowait = ts->iowait_sleeptime; } else { - if (ts->idle_active && nr_iowait_cpu(cpu) > 0) { + if (ts->idle_active && nr_iowait_cpu(cpu) > 0 && cpu_online(cpu)) { ktime_t delta = ktime_sub(now, ts->idle_entrytime); iowait = ktime_add(ts->iowait_sleeptime, delta); |
