diff options
author | Bo Yan <byan@nvidia.com> | 2013-04-02 10:44:52 -0700 |
---|---|---|
committer | Mrutyunjay Sawant <msawant@nvidia.com> | 2013-04-03 23:25:40 -0700 |
commit | c39878fb3d151a646cf290ccbf9a73b44d7a0a4f (patch) | |
tree | 2e93fbdc4cfeb2e94b4f529eb5431c898b40f9e8 /fs | |
parent | 8f646de983f24361814d9a6ca679845fb2265807 (diff) |
nohz: stat: Fix CPU iowait time accounting
Since cpustat[CPUTIME_IOWAIT] is never connected to
ts->iowait_sleeptime, never read from cpustat[CPUTIME_IOWAIT] 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_IOWAIT]
for CONFIG_NO_HZ or somehow connect them to keep them in sync.)
bug 1190321
Change-Id: Iee057315f871a5b99e3647494d3e4095e0c9680f
Signed-off-by: Bo Yan <byan@nvidia.com>
Reviewed-on: http://git-master/r/215620
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.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/proc/stat.c b/fs/proc/stat.c index ffcda1f263e9..734ececf77f8 100644 --- a/fs/proc/stat.c +++ b/fs/proc/stat.c @@ -62,11 +62,10 @@ static u64 get_iowait_time(int cpu) { u64 iowait, iowait_time = -1ULL; - if (cpu_online(cpu)) - iowait_time = get_cpu_iowait_time_us(cpu, NULL); + iowait_time = get_cpu_iowait_time_us(cpu, NULL); if (iowait_time == -1ULL) - /* !NO_HZ or cpu offline so we can rely on cpustat.iowait */ + /* !NO_HZ so we can rely on cpustat.iowait */ iowait = kcpustat_cpu(cpu).cpustat[CPUTIME_IOWAIT]; else iowait = usecs_to_cputime64(iowait_time); |