summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorBo Yan <byan@nvidia.com>2013-03-22 14:03:26 -0700
committerSimone Willett <swillett@nvidia.com>2013-04-05 14:56:17 -0700
commitb08f5935bacdcfd345339ecf70508dc49b24dc0f (patch)
tree150f226a7517fe57a2711d80b7720f168e16d305 /fs
parentcb617fec6c3e7a3d99dae7c72c8ddae5bbf64340 (diff)
nohz: stat: Fix CPU idle time accounting
Since cpustat[CPUTIME_IDLE] is never connected to ts->idle_sleeptime, never read from cpustat[CPUTIME_IDLE] when reporting stats in /proc/stat. Note this was rejected by Michal Hocko when it was initially proposed by Martin Schwidefsky in LKML, so if you want to upstream it, better find an alternative (either completely disable cpustat[CPUTIME_IDLE] for CONFIG_NO_HZ or somehow connect them to keep them in sync.) bug 1190321 Change-Id: Idc92488910b826aff850a010016d8326c7ab9e6c Signed-off-by: Bo Yan <byan@nvidia.com> Reviewed-on: http://git-master/r/214638 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Liang Cheng (SW) <licheng@nvidia.com> Tested-by: Liang Cheng (SW) <licheng@nvidia.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/proc/stat.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/proc/stat.c b/fs/proc/stat.c
index 6c91b17cb5fd..c1ddedf85c1e 100644
--- a/fs/proc/stat.c
+++ b/fs/proc/stat.c
@@ -45,7 +45,9 @@ static cputime64_t get_iowait_time(int cpu)
static u64 get_idle_time(int cpu)
{
- u64 idle, idle_time = get_cpu_idle_time_us(cpu, NULL);
+ u64 idle, idle_time = -1ULL;
+
+ idle_time = get_cpu_idle_time_us(cpu, NULL);
if (idle_time == -1ULL)
/* !NO_HZ so we can rely on cpustat.idle */