diff options
author | Sai Gurrappadi <sgurrappadi@nvidia.com> | 2014-03-25 20:45:38 -0700 |
---|---|---|
committer | Danny Song <dsong@nvidia.com> | 2014-04-01 00:06:42 -0700 |
commit | fb4377b803f588ac6ff51e0b68de2575a6a483cc (patch) | |
tree | e2b9c27681fffcf6efa75842e67497d2928096e5 /kernel | |
parent | 4886888e559afaf0671636abdefe7118b5642965 (diff) |
tick: Don't reset idle_sleeptime on CPU down
NOHZ related per-cpu data is reset on CPU down in order to prevent stale
data from causing issues. However, this breaks idle stats exposed by
/proc/stats because the idle counter can now decrease over time due to a
CPU down/up cycle.
Fix this by not resetting the idle_sleeptime field on CPU down. This
field shouldn't be used for any other purpose except idle time
accounting so it _should_ be safe to not clear this variable.
Bug 1484092
Change-Id: Ia57f5690672c0f35cf36098f92f242b94b545bb7
Signed-off-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-on: http://git-master/r/388030
GVS: Gerrit_Virtual_Submit
Tested-by: Nine Feng <nfeng@nvidia.com>
Reviewed-by: Danny Song <dsong@nvidia.com>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/time/tick-sched.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 2196248dabba..d5e365da04f7 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -860,6 +860,7 @@ void tick_setup_sched_timer(void) void tick_cancel_sched_timer(int cpu) { struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu); + ktime_t idle_sleeptime = ts->idle_sleeptime; # ifdef CONFIG_HIGH_RES_TIMERS if (ts->sched_timer.base) @@ -867,6 +868,7 @@ void tick_cancel_sched_timer(int cpu) # endif memset(ts, 0, sizeof(*ts)); + ts->idle_sleeptime = idle_sleeptime; } #endif |