diff options
-rw-r--r-- | arch/arm/kernel/setup.c | 4 | ||||
-rw-r--r-- | fs/proc/Kconfig | 12 | ||||
-rw-r--r-- | fs/proc/stat.c | 4 |
3 files changed, 20 insertions, 0 deletions
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index e514c76043b4..60496fac7bba 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -1002,7 +1002,11 @@ static int c_show(struct seq_file *m, void *v) cpu_name, read_cpuid_id() & 15, elf_platform); #if defined(CONFIG_SMP) +# if defined(CONFIG_REPORT_PRESENT_CPUS) + for_each_present_cpu(i) { +# else for_each_online_cpu(i) { +# endif /* * glibc reads /proc/cpuinfo to determine the number of * online processors, looking for lines beginning with diff --git a/fs/proc/Kconfig b/fs/proc/Kconfig index 15af6222f8a4..ddb83a0e15e8 100644 --- a/fs/proc/Kconfig +++ b/fs/proc/Kconfig @@ -67,3 +67,15 @@ config PROC_PAGE_MONITOR /proc/pid/smaps, /proc/pid/clear_refs, /proc/pid/pagemap, /proc/kpagecount, and /proc/kpageflags. Disabling these interfaces will reduce the size of the kernel by approximately 4kb. + +config REPORT_PRESENT_CPUS + default n + depends on PROC_FS && SMP + bool "Report present cpus instead of online cpus" + help + This is a work around to report Present CPUs instead of Online CPUs. + Some power savings implements use CPU hotplug for power domains. + It is a bug to enable this on a server or other architecture that + uses cpu hotplug in the correct way. + + diff --git a/fs/proc/stat.c b/fs/proc/stat.c index 9758b654a1bc..4b758ad5c831 100644 --- a/fs/proc/stat.c +++ b/fs/proc/stat.c @@ -75,7 +75,11 @@ static int show_stat(struct seq_file *p, void *v) (unsigned long long)cputime64_to_clock_t(steal), (unsigned long long)cputime64_to_clock_t(guest), (unsigned long long)cputime64_to_clock_t(guest_nice)); +#if defined(CONFIG_REPORT_PRESENT_CPUS) + for_each_present_cpu(i) { +#else for_each_online_cpu(i) { +#endif /* Copy values here to work around gcc-2.95.3, gcc-2.96 */ user = kstat_cpu(i).cpustat.user; |