From: boris.ostrovsky@oracle.com (Boris Ostrovsky)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 2/3] xen, cpu_hotplug: call device_offline instead of cpu_down
Date: Tue, 20 Oct 2015 08:55:38 -0400 [thread overview]
Message-ID: <562639CA.2010104@oracle.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1510201104120.27957@kaball.uk.xensource.com>
On 10/20/2015 06:28 AM, Stefano Stabellini wrote:
> On Mon, 19 Oct 2015, Boris Ostrovsky wrote:
>> On 10/19/2015 12:55 PM, Stefano Stabellini wrote:
>>> When offlining a cpu, instead of cpu_down, call device_offline, which
>>> also takes care of updating the cpu.dev.offline field. This keeps the
>>> sysfs file /sys/devices/system/cpu/cpuN/online, up to date. Also move
>>> the call to disable_hotplug_cpu, because it makes more sense to have it
>>> there.
>>>
>>> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>>> CC: konrad.wilk at oracle.com
>>> CC: boris.ostrovsky at oracle.com
>>> CC: david.vrabel at citrix.com
>>> ---
>>> drivers/xen/cpu_hotplug.c | 3 ++-
>>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/xen/cpu_hotplug.c b/drivers/xen/cpu_hotplug.c
>>> index 43de1f5..78804b5 100644
>>> --- a/drivers/xen/cpu_hotplug.c
>>> +++ b/drivers/xen/cpu_hotplug.c
>>> @@ -18,6 +18,8 @@ static void enable_hotplug_cpu(int cpu)
>>> static void disable_hotplug_cpu(int cpu)
>>> {
>>> + if (cpu_online(cpu))
>>> + device_offline(get_cpu_device(cpu));
>>> if (cpu_present(cpu))
>>> xen_arch_unregister_cpu(cpu);
>> Do we want to call device_online() when plugging cpu in?
> I don't know: that would automatically bring the cpu online after the
> user hot-plugs it. Is it what we want? Current one would have to manually:
>
> echo 1 > /sys/devices/system/cpu/cpu1/online
>
> I thought that was the expected behaviour?
Right, we should keep onlining as an explicit operation. I think it's
worth mentioning in the commit message why we don't call device_online()
while using device_offline(), which is its complement.
-boris
WARNING: multiple messages have this Message-ID (diff)
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: xen-devel@lists.xensource.com, david.vrabel@citrix.com,
linux-arm-kernel@lists.infradead.org, konrad.wilk@oracle.com
Subject: Re: [PATCH v3 2/3] xen, cpu_hotplug: call device_offline instead of cpu_down
Date: Tue, 20 Oct 2015 08:55:38 -0400 [thread overview]
Message-ID: <562639CA.2010104@oracle.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1510201104120.27957@kaball.uk.xensource.com>
On 10/20/2015 06:28 AM, Stefano Stabellini wrote:
> On Mon, 19 Oct 2015, Boris Ostrovsky wrote:
>> On 10/19/2015 12:55 PM, Stefano Stabellini wrote:
>>> When offlining a cpu, instead of cpu_down, call device_offline, which
>>> also takes care of updating the cpu.dev.offline field. This keeps the
>>> sysfs file /sys/devices/system/cpu/cpuN/online, up to date. Also move
>>> the call to disable_hotplug_cpu, because it makes more sense to have it
>>> there.
>>>
>>> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>>> CC: konrad.wilk@oracle.com
>>> CC: boris.ostrovsky@oracle.com
>>> CC: david.vrabel@citrix.com
>>> ---
>>> drivers/xen/cpu_hotplug.c | 3 ++-
>>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/xen/cpu_hotplug.c b/drivers/xen/cpu_hotplug.c
>>> index 43de1f5..78804b5 100644
>>> --- a/drivers/xen/cpu_hotplug.c
>>> +++ b/drivers/xen/cpu_hotplug.c
>>> @@ -18,6 +18,8 @@ static void enable_hotplug_cpu(int cpu)
>>> static void disable_hotplug_cpu(int cpu)
>>> {
>>> + if (cpu_online(cpu))
>>> + device_offline(get_cpu_device(cpu));
>>> if (cpu_present(cpu))
>>> xen_arch_unregister_cpu(cpu);
>> Do we want to call device_online() when plugging cpu in?
> I don't know: that would automatically bring the cpu online after the
> user hot-plugs it. Is it what we want? Current one would have to manually:
>
> echo 1 > /sys/devices/system/cpu/cpu1/online
>
> I thought that was the expected behaviour?
Right, we should keep onlining as an explicit operation. I think it's
worth mentioning in the commit message why we don't call device_online()
while using device_offline(), which is its complement.
-boris
next prev parent reply other threads:[~2015-10-20 12:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-19 16:54 [PATCH v3] xen,arm: enable cpu_hotplug Stefano Stabellini
2015-10-19 16:54 ` Stefano Stabellini
2015-10-19 16:55 ` [PATCH v3 1/3] xen/arm: Enable cpu_hotplug.c Stefano Stabellini
2015-10-19 16:55 ` Stefano Stabellini
2015-10-19 16:55 ` [PATCH v3 2/3] xen, cpu_hotplug: call device_offline instead of cpu_down Stefano Stabellini
2015-10-19 16:55 ` Stefano Stabellini
2015-10-19 18:24 ` Boris Ostrovsky
2015-10-19 18:24 ` Boris Ostrovsky
2015-10-20 10:28 ` Stefano Stabellini
2015-10-20 10:28 ` Stefano Stabellini
2015-10-20 12:55 ` Boris Ostrovsky [this message]
2015-10-20 12:55 ` Boris Ostrovsky
2015-10-19 16:55 ` [PATCH v3 3/3] xen/arm: don't try to re-register vcpu_info on cpu_hotplug Stefano Stabellini
2015-10-19 16:55 ` Stefano Stabellini
2015-10-19 17:01 ` Julien Grall
2015-10-19 17:01 ` Julien Grall
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=562639CA.2010104@oracle.com \
--to=boris.ostrovsky@oracle.com \
--cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.