diff options
| author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-11-16 11:41:51 +0200 | 
|---|---|---|
| committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-11-16 11:41:51 +0200 | 
| commit | 3c3dd225819112e56554162c6b37e61a31924e0c (patch) | |
| tree | 5bcd3a63010af2cd5bb946b5af21ef27f1dcfe3c /fs/proc/stat.c | |
| parent | a915d4ca24b814daee9cddbc42cd41f59fe4fa8f (diff) | |
| parent | 3d70f8c617a436c7146ecb81df2265b4626dfe89 (diff) | |
Merge tag 'v3.7-rc4'
Merge Linux 3.7-rc4 to get fixes for CMA.
Diffstat (limited to 'fs/proc/stat.c')
| -rw-r--r-- | fs/proc/stat.c | 14 | 
1 files changed, 10 insertions, 4 deletions
diff --git a/fs/proc/stat.c b/fs/proc/stat.c index 64c3b317236..e296572c73e 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);  | 
