diff options
-rw-r--r-- | Documentation/00-INDEX | 4 | ||||
-rw-r--r-- | fs/proc/stat.c | 14 |
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. |
211 | lockdep-design.txt | 211 | lockdep-design.txt |
212 | - documentation on the runtime locking correctness validator. | 212 | - documentation on the runtime locking correctness validator. |
213 | lockup-watchdogs.txt | ||
214 | - info on soft and hard lockup detectors (aka nmi_watchdog). | ||
213 | logo.gif | 215 | logo.gif |
214 | - full colour GIF image of Linux logo (penguin - Tux). | 216 | - full colour GIF image of Linux logo (penguin - Tux). |
215 | logo.txt | 217 | logo.txt |
@@ -240,8 +242,6 @@ netlabel/ | |||
240 | - directory with information on the NetLabel subsystem. | 242 | - directory with information on the NetLabel subsystem. |
241 | networking/ | 243 | networking/ |
242 | - directory with info on various aspects of networking with Linux. | 244 | - directory with info on various aspects of networking with Linux. |
243 | nmi_watchdog.txt | ||
244 | - info on NMI watchdog for SMP systems. | ||
245 | nommu-mmap.txt | 245 | nommu-mmap.txt |
246 | - documentation about no-mmu memory mapping support. | 246 | - documentation about no-mmu memory mapping support. |
247 | numastat.txt | 247 | numastat.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 | ||
46 | static u64 get_idle_time(int cpu) | 46 | static 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 | ||
59 | static u64 get_iowait_time(int cpu) | 62 | static 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); |