summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorJon Mayo <jmayo@nvidia.com>2011-06-21 15:44:35 -0700
committerVarun Colbert <vcolbert@nvidia.com>2011-07-29 17:16:28 -0700
commit002c920f591737632293a024eff5adc5505fcf67 (patch)
tree5e21f2cd17a50c07caf1d44b9323003c66c24bcf /fs
parent8c0035555d1f0c52088cec7f61a442d5d5c751c1 (diff)
ARM: report present cpus instead of online CPUs
For machines that use hotplug to control special power domains, report present cpus in /proc/cpuinfo and /proc/stat instead of the standard of reporting online. This break hotplug behavior on all other platforms. The option is enabled using CONFIG_REPORT_PRESENT_CPUS Bug 849167 Change-Id: Ib04bb73634b3a8c99592b1ac13eb471a8ecfd0c5 Reviewed-on: http://git-master/r/37732 Reviewed-by: Jonathan Mayo <jmayo@nvidia.com> Tested-by: Jonathan Mayo <jmayo@nvidia.com> Reviewed-by: Aleksandr Frid <afrid@nvidia.com> Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/proc/Kconfig12
-rw-r--r--fs/proc/stat.c4
2 files changed, 16 insertions, 0 deletions
diff --git a/fs/proc/Kconfig b/fs/proc/Kconfig
index 50f8f0600f06..ecd5afeaac49 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 bf31b03fc275..4ef9702bd792 100644
--- a/fs/proc/stat.c
+++ b/fs/proc/stat.c
@@ -78,7 +78,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;