linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
To: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Deepthi Dharwar <deepthi@linux.vnet.ibm.com>,
	linux-acpi@vger.kernel.org, linux-pm@lists.linux-foundation.org,
	trenn@suse.de, Linux PM mailing list <linux-pm@vger.kernel.org>,
	lenb@kernel.org, "Rafael J. Wysocki" <rjw@sisk.pl>
Subject: [PATCH] acpi, cpuidle: Register with cpuidle even if cpu is onlined after boot (beyond maxcpus)
Date: Mon, 25 Jun 2012 16:55:43 +0530	[thread overview]
Message-ID: <4FE84AB7.6020305@linux.vnet.ibm.com> (raw)
In-Reply-To: <4FE027AC.8010607@linaro.org>


Daniel Lezcano noticed that after booting with maxcpus=X, if we online the
remaining cpus by writing: echo 1 > /sys/devices/system/cpu/cpuY/online, then
for the newly onlined cpus, the cpuidle directory is not found under
/sys/devices/system/cpu/cpuY.

Partly, the reason for this is that acpi restricts the initialization to cpus
within the maxcpus limit. (See commit 75cbfb9 "ACPI: Do not try to set up acpi
processor stuff on cores exceeding maxcpus="). The maxcpus= kernel parameter is
used to restrict the number of cpus brought up during boot. That doesn't mean
that we should hard restrict the bring up of the remaining cpus later on. So
teach acpi to play nice with maxcpus= parameter, and perform the initialization
for all present cpus, but defer their startup to the point when they are
actually onlined later.

But that alone won't suffice as a fix, because there is one more thing that
the present but !online cpus lack - the need_hotplug_init flag.
The need_hotplug_init flag is set only for physically hotplugged cpus and not
for cpus which were already present but not brought online during boot (due to
the maxcpus= parameter). For cpus with this flag set, during the online
operation, acpi_cpu_soft_notify() takes care of the registration with cpuidle.
So, in order to allow the present but !online cpus to be onlined later with
full features (by making use of acpi_cpu_soft_notify()), set their
need_hotplug_init flag.

Reported-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
---

Daniel, this patch works for me. Does it work for you as well?

 drivers/acpi/processor_driver.c |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
index 0734086..f29d30f 100644
--- a/drivers/acpi/processor_driver.c
+++ b/drivers/acpi/processor_driver.c
@@ -551,11 +551,6 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device)
 		return 0;
 	}
 
-#ifdef CONFIG_SMP
-	if (pr->id >= setup_max_cpus && pr->id != 0)
-		return 0;
-#endif
-
 	BUG_ON((pr->id >= nr_cpu_ids) || (pr->id < 0));
 
 	/*
@@ -580,6 +575,17 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device)
 		goto err_clear_processor;
 	}
 
+#ifdef CONFIG_SMP
+	if (pr->id >= setup_max_cpus && pr->id != 0) {
+		/*
+		 * Don't start cpus beyond maxcpus now. But allow them to
+		 * to be brought online later.
+		 */
+		pr->flags.need_hotplug_init = 1;
+		return 0;
+	}
+#endif
+
 	/*
 	 * Do not start hotplugged CPUs now, but when they
 	 * are onlined the first time



  parent reply	other threads:[~2012-06-25 11:26 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-15 15:28 acpi_idle and max_cpus Daniel Lezcano
2012-06-17 20:18 ` Daniel Lezcano
2012-06-18 12:25   ` Deepthi Dharwar
2012-06-18 12:54     ` [linux-pm] " Daniel Lezcano
2012-06-19  6:54       ` Deepthi Dharwar
2012-06-19  7:03         ` Srivatsa S. Bhat
2012-06-19  7:18           ` Daniel Lezcano
2012-06-19 15:30             ` Thomas Renninger
2012-06-25 11:25             ` Srivatsa S. Bhat [this message]
2012-06-25 13:53               ` [PATCH] acpi, cpuidle: Register with cpuidle even if cpu is onlined after boot (beyond maxcpus) Thomas Renninger
2012-06-25 16:03                 ` Srivatsa S. Bhat
2012-06-26  9:29                   ` Thomas Renninger
2012-06-26  9:41                     ` Daniel Lezcano
2012-06-26  9:58                       ` Srivatsa S. Bhat
2012-06-26 10:42                         ` Daniel Lezcano
2012-06-26 11:01                           ` Thomas Renninger
2012-06-27  9:07                             ` [PATCH] acpi: intel_idle : break dependency between modules Daniel Lezcano
2012-06-27 13:06                               ` Thomas Renninger
     [not found]                                 ` <201206271506.29034.trenn-l3A5Bk7waGM@public.gmane.org>
2012-06-28  8:03                                   ` Daniel Lezcano
2012-06-28  8:46                                 ` [PATCH v2] " Daniel Lezcano
2012-06-28 11:24                                   ` Srivatsa S. Bhat
2012-06-28 11:27                                     ` Daniel Lezcano
2012-06-28 11:56                                       ` Srivatsa S. Bhat
2012-06-28 19:24                                   ` Rafael J. Wysocki
2012-06-29  8:39                                     ` Daniel Lezcano
2012-06-29 22:27                                       ` Rafael J. Wysocki
2012-07-01 19:36                                         ` Daniel Lezcano
2012-06-27 16:16                               ` [PATCH] " Srivatsa S. Bhat
2012-06-28  7:34                                 ` [linux-pm] " Thomas Renninger
2012-06-28 11:23                                   ` Srivatsa S. Bhat
2012-06-26 11:07                           ` [PATCH] acpi, cpuidle: Register with cpuidle even if cpu is onlined after boot (beyond maxcpus) Srivatsa S. Bhat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FE84AB7.6020305@linux.vnet.ibm.com \
    --to=srivatsa.bhat@linux.vnet.ibm.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=deepthi@linux.vnet.ibm.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=trenn@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).