diff options
author | Jon Mayo <jmayo@nvidia.com> | 2011-06-21 15:44:35 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:47:58 -0800 |
commit | 84fca9fbd451e7a12febf620e28235ed74022371 (patch) | |
tree | 30fff3d5bcba3ebfbe569b6b123ce3479bec822c /fs | |
parent | ba754afaff4791cf8ec5a7032a352b4d627837dc (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
Original-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>
Rebase-Id: R746f854d51a4b8f15774a547a3219acf7576bf6e
Diffstat (limited to 'fs')
-rw-r--r-- | fs/proc/Kconfig | 12 | ||||
-rw-r--r-- | fs/proc/stat.c | 4 |
2 files changed, 16 insertions, 0 deletions
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; |