]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
ARM: report present cpus instead of online CPUs
authorJon Mayo <jmayo@nvidia.com>
Tue, 21 Jun 2011 22:44:35 +0000 (15:44 -0700)
committerDan Willemsen <dwillemsen@nvidia.com>
Sat, 14 Sep 2013 08:32:22 +0000 (01:32 -0700)
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

arch/arm/kernel/setup.c
fs/proc/Kconfig
fs/proc/stat.c

index b4b1d397592b3d6435c0a503541c37d3fffcc016..8e31172084ca0e008f598375a1266de25b07e9b5 100644 (file)
@@ -880,7 +880,11 @@ static int c_show(struct seq_file *m, void *v)
        int i, j;
        u32 cpuid;
 
+# 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
index 15af6222f8a4fb465251dd97610460a9bc79639e..ddb83a0e15e896b1c41c92497f8ed11ee180b7cf 100644 (file)
@@ -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.
+
+
index 1cf86c0e868930585d0058b7943cc047367802f3..36a15504b6e95476386fb057936b6dac172b49a5 100644 (file)
@@ -130,7 +130,12 @@ static int show_stat(struct seq_file *p, void *v)
        seq_put_decimal_ull(p, ' ', cputime64_to_clock_t(guest_nice));
        seq_putc(p, '\n');
 
+#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 = kcpustat_cpu(i).cpustat[CPUTIME_USER];
                nice = kcpustat_cpu(i).cpustat[CPUTIME_NICE];