aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/00-INDEX4
-rw-r--r--fs/proc/stat.c14
2 files changed, 12 insertions, 6 deletions
diff --git a/Documentation/00-INDEX b/Documentation/00-INDEX
index f54273e2ac97..ceb1ff735469 100644
--- a/Documentation/00-INDEX
+++ b/Documentation/00-INDEX
@@ -210,6 +210,8 @@ local_ops.txt
210 - semantics and behavior of local atomic operations. 210 - semantics and behavior of local atomic operations.
211lockdep-design.txt 211lockdep-design.txt
212 - documentation on the runtime locking correctness validator. 212 - documentation on the runtime locking correctness validator.
213lockup-watchdogs.txt
214 - info on soft and hard lockup detectors (aka nmi_watchdog).
213logo.gif 215logo.gif
214 - full colour GIF image of Linux logo (penguin - Tux). 216 - full colour GIF image of Linux logo (penguin - Tux).
215logo.txt 217logo.txt
@@ -240,8 +242,6 @@ netlabel/
240 - directory with information on the NetLabel subsystem. 242 - directory with information on the NetLabel subsystem.
241networking/ 243networking/
242 - directory with info on various aspects of networking with Linux. 244 - directory with info on various aspects of networking with Linux.
243nmi_watchdog.txt
244 - info on NMI watchdog for SMP systems.
245nommu-mmap.txt 245nommu-mmap.txt
246 - documentation about no-mmu memory mapping support. 246 - documentation about no-mmu memory mapping support.
247numastat.txt 247numastat.txt
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)
45 45
46static u64 get_idle_time(int cpu) 46static u64 get_idle_time(int cpu)
47{ 47{
48 u64 idle, idle_time = get_cpu_idle_time_us(cpu, NULL); 48 u64 idle, idle_time = -1ULL;
49
50 if (cpu_online(cpu))
51 idle_time = get_cpu_idle_time_us(cpu, NULL);
49 52
50 if (idle_time == -1ULL) 53 if (idle_time == -1ULL)
51 /* !NO_HZ so we can rely on cpustat.idle */ 54 /* !NO_HZ or cpu offline so we can rely on cpustat.idle */
52 idle = kcpustat_cpu(cpu).cpustat[CPUTIME_IDLE]; 55 idle = kcpustat_cpu(cpu).cpustat[CPUTIME_IDLE];
53 else 56 else
54 idle = usecs_to_cputime64(idle_time); 57 idle = usecs_to_cputime64(idle_time);
@@ -58,10 +61,13 @@ static u64 get_idle_time(int cpu)
58 61
59static u64 get_iowait_time(int cpu) 62static u64 get_iowait_time(int cpu)
60{ 63{
61 u64 iowait, iowait_time = get_cpu_iowait_time_us(cpu, NULL); 64 u64 iowait, iowait_time = -1ULL;
65
66 if (cpu_online(cpu))
67 iowait_time = get_cpu_iowait_time_us(cpu, NULL);
62 68
63 if (iowait_time == -1ULL) 69 if (iowait_time == -1ULL)
64 /* !NO_HZ so we can rely on cpustat.iowait */ 70 /* !NO_HZ or cpu offline so we can rely on cpustat.iowait */
65 iowait = kcpustat_cpu(cpu).cpustat[CPUTIME_IOWAIT]; 71 iowait = kcpustat_cpu(cpu).cpustat[CPUTIME_IOWAIT];
66 else 72 else
67 iowait = usecs_to_cputime64(iowait_time); 73 iowait = usecs_to_cputime64(iowait_time);