summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorSai Gurrappadi <sgurrappadi@nvidia.com>2014-03-25 20:45:38 -0700
committerDiwakar Tundlam <dtundlam@nvidia.com>2014-04-02 12:11:24 -0700
commit0728131797240300a60c9cf4fc75e26cbd983e2b (patch)
tree711595176a55eec458007baa22af6080d8465cde /kernel
parent5c5bd74669bff202379b572bf2479bc5713d0feb (diff)
tick: Don't clear idle and iowait sums on CPU down
NOHZ related per-cpu data is cleared on CPU down. This was introduced by 4b0c0f294 "tick: Cleanup NOHZ per cpu data on cpu down" which breaks /proc/stats because the idle and iowait sums are now non-monotonic across a CPU down/up cycle. Fix this by not clearing the idle_sleeptime and iowait_sleeptime fields on CPU down. Bug 1484092 Change-Id: Ia57f5690672c0f35cf36098f92f242b94b545bb7 Signed-off-by: Sai Gurrappadi <sgurrappadi@nvidia.com> Reviewed-on: http://git-master/r/386664 Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/time/tick-sched.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index da00c96989d3..73b332ef4a56 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -1156,6 +1156,17 @@ void tick_setup_sched_timer(void)
#endif /* HIGH_RES_TIMERS */
#if defined CONFIG_NO_HZ_COMMON || defined CONFIG_HIGH_RES_TIMERS
+
+static inline void clear_tick_sched(struct tick_sched *ts)
+{
+ ktime_t idle_sleeptime = ts->idle_sleeptime;
+ ktime_t iowait_sleeptime = ts->iowait_sleeptime;
+
+ memset(ts, 0, sizeof(*ts));
+ ts->idle_sleeptime = idle_sleeptime;
+ ts->iowait_sleeptime = iowait_sleeptime;
+}
+
void tick_cancel_sched_timer(int cpu)
{
struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu);
@@ -1165,7 +1176,7 @@ void tick_cancel_sched_timer(int cpu)
hrtimer_cancel(&ts->sched_timer);
# endif
- memset(ts, 0, sizeof(*ts));
+ clear_tick_sched(ts);
}
#endif