summaryrefslogtreecommitdiffstats
path: root/fs/proc/stat.c
diff options
context:
space:
mode:
authorKukjin Kim <kgene.kim@samsung.com>2012-11-20 18:19:10 +0900
committerKukjin Kim <kgene.kim@samsung.com>2012-11-20 18:19:10 +0900
commit840ed42942cc1ebbda2ed55f4019673b537fc5de (patch)
tree415644488e3966837eeb5061d96d4ca7db862318 /fs/proc/stat.c
parent0dca30003bc752b2fc15906e562ef4e4925725fd (diff)
parent0a9d5ac307aefbb2c772537d3fe7f75046d563ac (diff)
downloadtalos-op-linux-840ed42942cc1ebbda2ed55f4019673b537fc5de.tar.gz
talos-op-linux-840ed42942cc1ebbda2ed55f4019673b537fc5de.zip
Merge branch 'next/hdmi-samsung' into next/devel-samsung
Diffstat (limited to 'fs/proc/stat.c')
-rw-r--r--fs/proc/stat.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/fs/proc/stat.c b/fs/proc/stat.c
index 64c3b3172367..e296572c73ed 100644
--- a/fs/proc/stat.c
+++ b/fs/proc/stat.c
@@ -45,10 +45,13 @@ 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;
+
+ if (cpu_online(cpu))
+ idle_time = get_cpu_idle_time_us(cpu, NULL);
if (idle_time == -1ULL)
- /* !NO_HZ so we can rely on cpustat.idle */
+ /* !NO_HZ or cpu offline so we can rely on cpustat.idle */
idle = kcpustat_cpu(cpu).cpustat[CPUTIME_IDLE];
else
idle = usecs_to_cputime64(idle_time);
@@ -58,10 +61,13 @@ static u64 get_idle_time(int cpu)
static u64 get_iowait_time(int cpu)
{
- u64 iowait, iowait_time = get_cpu_iowait_time_us(cpu, NULL);
+ u64 iowait, iowait_time = -1ULL;
+
+ if (cpu_online(cpu))
+ iowait_time = get_cpu_iowait_time_us(cpu, NULL);
if (iowait_time == -1ULL)
- /* !NO_HZ so we can rely on cpustat.iowait */
+ /* !NO_HZ or cpu offline so we can rely on cpustat.iowait */
iowait = kcpustat_cpu(cpu).cpustat[CPUTIME_IOWAIT];
else
iowait = usecs_to_cputime64(iowait_time);
OpenPOWER on IntegriCloud