diff options
author | Bo Yan <byan@nvidia.com> | 2013-03-22 14:03:26 -0700 |
---|---|---|
committer | Riham Haidar <rhaidar@nvidia.com> | 2013-03-25 22:53:49 -0700 |
commit | e7a9220f5883bf3816e24895a34239a34a7d9ece (patch) | |
tree | 9ae6f0a84f6ea5b8670261b093da82e6cacd12d9 /fs | |
parent | f1af9df69fba43ac27cdad51191f4043a648149a (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/212224
Reviewed-by: Liang Cheng (SW) <licheng@nvidia.com>
Tested-by: Liang Cheng (SW) <licheng@nvidia.com>
Reviewed-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/proc/stat.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/proc/stat.c b/fs/proc/stat.c index 98bf0c2738d6..ffcda1f263e9 100644 --- a/fs/proc/stat.c +++ b/fs/proc/stat.c @@ -47,11 +47,10 @@ static u64 get_idle_time(int cpu) { u64 idle, idle_time = -1ULL; - if (cpu_online(cpu)) - idle_time = get_cpu_idle_time_us(cpu, NULL); + idle_time = get_cpu_idle_time_us(cpu, NULL); if (idle_time == -1ULL) - /* !NO_HZ or cpu offline so we can rely on cpustat.idle */ + /* !NO_HZ so we can rely on cpustat.idle */ idle = kcpustat_cpu(cpu).cpustat[CPUTIME_IDLE]; else idle = usecs_to_cputime64(idle_time); |