linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
Cc: Linux PM mailing list <linux-pm@vger.kernel.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	linux-acpi@vger.kernel.org, linux-pm@lists.linux-foundation.org
Subject: Re: [PATCH] acpi, cpuidle: Register with cpuidle even if cpu is onlined after boot (beyond maxcpus)
Date: Tue, 26 Jun 2012 12:42:14 +0200	[thread overview]
Message-ID: <4FE99206.8060109@linaro.org> (raw)
In-Reply-To: <4FE987BB.4020508@linux.vnet.ibm.com>

On 06/26/2012 11:58 AM, Srivatsa S. Bhat wrote:
> On 06/26/2012 03:11 PM, Daniel Lezcano wrote:
>> On 06/26/2012 11:29 AM, Thomas Renninger wrote:
>>> On Monday, June 25, 2012 06:03:42 PM Srivatsa S. Bhat wrote:
>>>> On 06/25/2012 07:23 PM, Thomas Renninger wrote:
>>>>
>>>>> On Monday, June 25, 2012 01:25:43 PM Srivatsa S. Bhat wrote:
>>>>>>
>>>>>> 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.
>>>>>
>>>>> Sorry, but IMO it exaclty does mean that (adding more general lists for
>>>>> further comments).
>>>>>
>>>>> If you can online more cores than maxcpus= via sysfs, this sounds like a bug.
>>>>> Not the other way around.
>>>>>
>>>>> Compare with Documentation/kernel-parameters.txt:
>>>>>         maxcpus=        [SMP] Maximum number of processors that an SMP kernel
>>>>>                         should make use of.  maxcpus=n : n >= 0 limits the
>>>>>                         kernel to using 'n' processors.  n=0 is a special case,
>>>>>                         it is equivalent to "nosmp", which also disables
>>>>>                         the IO APIC.
>>>>>
>>>>> Chances that you run into more problems are high.
>>>>
>>>>
>>>> Right, I agree on that. So, IMHO, maxcpus=X doesn't mean that the kernel must and
>>>> should forbid any new cpus from coming online, but in the interest of avoiding
>>>> problems/complications in some obscure paths, I guess it makes sense to avoid
>>>> onlining new cpus beyond maxcpus.
>>>
>>> Yep, for such reasons:
>>>    - That nobody realizes this to be useful and makes use of it in a productive
>>>      environment
>>>    - If I see maxcpus=X in a bugreport's dmesg command line,
>>>      I want to be sure that's true.
>>>    - To enforce that things work as documented
>>>
>>>
>>> Wow, after looking a bit into this I found (Documentation/cpu-hotplug.txt):
>>>
>>> maxcpus=n    Restrict boot time cpus to n. Say if you have 4 cpus, using
>>>              maxcpus=2 will only boot 2. You can choose to bring the
>>>              other cpus later online, read FAQ's for more info.
>>>
>>> Looks like someone already documented this (IMO broken) behavior.
>>> I didn't find further info in the FAQs.
>>>
>>>> In any case, I was just trying to see why the simple removal of the setup_max_cpus
>>>> check in acpi_processor_add() wasn't enough to expose the cpuidle directories under
>>>> the new cpus.. and while debugging that, I came up with this patch. I don't mind
>>>> if this doesn't get picked up.
>>>
>>>> Right, the usecase of why somebody would like to online new cpus beyond maxcpus
>>>> doesn't look all that solid anyway. So I am OK with leaving the code as it is now.
>>>
>>> In the end this is a debug option, I expect everybody is aware of that.
>>> Yep, let's just leave it...
>>
>> In this case, let's remove the intel_idle_cpu_init stuff in
>> acpi_cpu_soft_notify, no ?
>>
> 
> Why? And how would that help? The intel_idle_cpu_init() call is essential if intel_idle
> driver is being used instead of acpi idle.

AFAIU, this code is not called after onlining a cpu greater than maxcpus
and Thomas thinks that system with cpu hotplug at runtime are not sold.

The problem I see with this code is acpi and intel-idle are tied
together now. I would like to break this dependency and use the notifier
to handle the cpu hotplug directly in intel-idle.

It is hard to test my patch as there is not such system and maxcpus is
not correctly handled here. I can use your patch to test my patch but
anyway ... I am just asking if that would make sense to remove this
portion of code instead :)

If we want to keep this code untouched, I can try my patch and maybe
Thomas will agreed to test it also on a cpu-online-runtime-system if he
has one.

Thanks
  -- Daniel

-- 
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

  reply	other threads:[~2012-06-26 10:42 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             ` [PATCH] acpi, cpuidle: Register with cpuidle even if cpu is onlined after boot (beyond maxcpus) Srivatsa S. Bhat
2012-06-25 13:53               ` 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 [this message]
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=4FE99206.8060109@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=srivatsa.bhat@linux.vnet.ibm.com \
    --cc=x86@kernel.org \
    /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).