android_kernel_samsung_msm8976/fs/proc
Michal Hocko a25cac5198 proc: Consider NO_HZ when printing idle and iowait times
show_stat handler of the /proc/stat file relies on kstat_cpu(cpu)
statistics when priting information about idle and iowait times.
This is OK if we are not using tickless kernel (CONFIG_NO_HZ) because
counters are updated periodically.
With NO_HZ things got more tricky because we are not doing idle/iowait
accounting while we are tickless so the value might get outdated.
Users of /proc/stat will notice that by unchanged idle/iowait values
which is then interpreted as 0% idle/iowait time. From the user space
POV this is an unexpected behavior and a change of the interface.

Let's fix this by using get_cpu_{idle,iowait}_time_us which accounts the
total idle/iowait time since boot and it doesn't rely on sampling or any
other periodic activity. Fall back to the previous behavior if NO_HZ is
disabled or not configured.

Signed-off-by: Michal Hocko <mhocko@suse.cz>
Cc: Dave Jones <davej@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Link: http://lkml.kernel.org/r/39181366adac1b39cb6aa3cd53ff0f7c78d32676.1314172057.git.mhocko@suse.cz
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2011-09-08 11:10:55 +02:00
..
array.c
base.c vfs: show O_CLOEXE bit properly in /proc/<pid>/fdinfo/<fd> files 2011-08-06 11:51:33 -07:00
cmdline.c
consoles.c
cpuinfo.c
devices.c
generic.c proc: make struct proc_dir_entry::name a terminal array rather than a pointer 2011-07-27 12:50:45 -07:00
inode.c
internal.h
interrupts.c
Kconfig
kcore.c
kmsg.c
loadavg.c
Makefile
meminfo.c
mmu.c
namespaces.c
nommu.c
page.c
proc_devtree.c
proc_net.c proc: make struct proc_dir_entry::name a terminal array rather than a pointer 2011-07-27 12:50:45 -07:00
proc_sysctl.c
proc_tty.c
root.c proc: make struct proc_dir_entry::name a terminal array rather than a pointer 2011-07-27 12:50:45 -07:00
softirqs.c
stat.c proc: Consider NO_HZ when printing idle and iowait times 2011-09-08 11:10:55 +02:00
task_mmu.c
task_nommu.c
uptime.c
version.c
vmcore.c