All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mirela Simonovic <mirela.simonovic@aggios.com>
To: Julien Grall <julien.grall@arm.com>
Cc: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Davorin Mista <dm@aggios.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Xen Devel <xen-devel@lists.xen.org>,
	Jan Beulich <JBeulich@suse.com>
Subject: Re: [PATCH 4/7] xen/arm: When CPU dies, free percpu area immediatelly
Date: Tue, 17 Apr 2018 12:52:21 +0200	[thread overview]
Message-ID: <CAKPH-NiKO+HA6M2GV3VGuh_FhSYSN6NHLVrU_8RsSKFdQCOvXA@mail.gmail.com> (raw)
In-Reply-To: <ca23e8da-6922-66a1-37c4-a3198504fcdb@arm.com>

Hi Julien,

On Mon, Apr 16, 2018 at 5:21 PM, Julien Grall <julien.grall@arm.com> wrote:
>
>
> On 16/04/18 14:41, Mirela Simonovic wrote:
>>
>> On Mon, Apr 16, 2018 at 3:14 PM, Julien Grall <julien.grall@arm.com>
>> wrote:
>>>
>>> On 12/04/18 22:31, Stefano Stabellini wrote:
>>>>
>>>> On Thu, 12 Apr 2018, Julien Grall wrote:
>>>>>
>>>>> On 12/04/18 00:46, Stefano Stabellini wrote:
>>>>>>
>>>>>> On Wed, 11 Apr 2018, Julien Grall wrote:
>>>>>>>
>>>>>>> On 11/04/18 14:19, Mirela Simonovic wrote:
>>>
>>> I guess the rcu_barrier() in the function handling suspend/resume works.
>>> But
>>> that doesn't cover the hotplug case. Looking at x86, suspend/resume case.
>>> For the hotplug case, there are an rcu_barrier in cpu_{up,down}_helper
>>> but
>>> they are only present in the case of cpu_{up,down} failed. I am not
>>> entirely
>>> sure how this is handled in x86
>>>
>>> Andrew, Jan, do you know when the percpu will be free on hotplug? It is
>>> call
>>> to call_rcu(...) but I am not sure when this is going to be executed.
>>>
>>
>> AFAIK disable/enable_nonboot_cpus() is the only way to do the hotplug
>> and rcu_barrier() is not included in the flow.
>
>
> That's not the only way. I clearly specified one in my previous answer (see
> cpu_{up,down}_helper) and there are other place (look for cpu_up).
>

I've looked at cpu_{up,down}_helper and cpu_up and I'm convinced now
that adding rcu_barrier() prior to calling enable_nonboot_cpus() is
the right approch.

cpu_{up,down}_helper functions exist only for x86. cpu_up_helper()
does call rcu_barrier() prior to calling cpu_up().
So calling rcu_barrier() is expected to be done prior to calling
cpu_up() (or enable_nonboot_cpus(), which is just a wrapper for
cpu_up()).

I believe this is right way to do because cpu_up() is used for
enabling non-boot CPUs in both boot and suspend/hotplug scenarios,
while rcu_barrier() is not required in boot scenario.
Therefore, I'll add rcu_barrier() prior to calling
enable_nonboot_cpus(). If I missed something please let me know.

Thanks,
Mirela

> Cheers,
>
> --
> Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2018-04-17 10:52 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-11 13:19 [PATCH 0/7] xen/arm: CPU hotplug fixes Mirela Simonovic
2018-04-11 13:19 ` [PATCH 1/7] xen/arm: Added handling of the trapped access to OSLSR register Mirela Simonovic
2018-04-11 14:39   ` Julien Grall
2018-04-11 23:28     ` Stefano Stabellini
2018-04-11 13:19 ` [PATCH 2/7] xen/arm/vgic-v2: Ignore write to GICD_ISACTIVERn registers Mirela Simonovic
2018-04-11 14:43   ` Julien Grall
2018-04-11 23:31     ` Stefano Stabellini
2018-04-12 11:15       ` Mirela Simonovic
2018-04-11 13:19 ` [PATCH 3/7] xen/arm/psci: Implement CPU_OFF PSCI call (physical interface) Mirela Simonovic
2018-04-11 14:46   ` Julien Grall
2018-04-12 11:33     ` Mirela Simonovic
2018-04-12 13:31       ` Julien Grall
2018-04-16 10:02         ` Mirela Simonovic
2018-04-16 14:26           ` Julien Grall
2018-04-16 16:52             ` Mirela Simonovic
2018-04-16 17:02               ` Julien Grall
2018-04-11 13:19 ` [PATCH 4/7] xen/arm: When CPU dies, free percpu area immediatelly Mirela Simonovic
2018-04-11 14:53   ` Julien Grall
2018-04-11 23:46     ` Stefano Stabellini
2018-04-12  8:53       ` Julien Grall
2018-04-12 21:31         ` Stefano Stabellini
2018-04-16 13:14           ` Julien Grall
2018-04-16 13:41             ` Mirela Simonovic
2018-04-16 15:21               ` Julien Grall
2018-04-17 10:52                 ` Mirela Simonovic [this message]
2018-04-17 11:02                   ` Julien Grall
2018-04-18 22:52                     ` Stefano Stabellini
2018-04-19  9:32                       ` Julien Grall
2018-04-11 13:19 ` [PATCH 5/7] xen/arm: Remove __initdata and __init to enable CPU hotplug Mirela Simonovic
2018-04-12  0:07   ` Stefano Stabellini
2018-04-12  9:03     ` Julien Grall
2018-04-12 12:50       ` Mirela Simonovic
2018-04-12 12:56         ` Julien Grall
2018-04-12 13:55           ` Mirela Simonovic
2018-04-11 13:19 ` [PATCH 6/7] xen/arm: Setup virtual paging for secondary CPUs in non-boot scenario Mirela Simonovic
2018-04-11 15:11   ` Julien Grall
2018-04-17 12:54     ` Mirela Simonovic
2018-04-17 14:11       ` Julien Grall
2018-04-17 15:22         ` Mirela Simonovic
2018-04-18  9:48           ` Julien Grall
2018-04-18 10:34             ` Mirela Simonovic
2018-04-18 10:45         ` Mirela Simonovic
2018-04-18 10:58           ` Julien Grall
2018-04-18 22:56             ` Stefano Stabellini
2018-04-11 13:19 ` [PATCH 7/7] xen/arm: Restore IRQ affinity after hotplugging a CPU Mirela Simonovic
2018-04-11 14:55   ` Julien Grall
2018-04-12  0:20   ` Stefano Stabellini
2018-04-12  7:38     ` Mirela Simonovic
2018-04-12 16:49   ` Dario Faggioli
2018-04-13 10:11     ` Mirela Simonovic
2018-04-16 12:38       ` Dario Faggioli
2018-04-11 15:07 ` [PATCH 0/7] xen/arm: CPU hotplug fixes Julien Grall
2018-04-11 15:58   ` Mirela Simonovic
2018-04-11 16:02     ` Julien Grall
2018-04-11 16:37       ` Mirela Simonovic
2018-04-12  8:43         ` Julien Grall
2018-04-13 10:19           ` Mirela Simonovic
2018-04-16 11:33             ` Julien Grall
2018-04-16 14:06               ` Mirela Simonovic
2018-04-16 15:05                 ` Julien Grall
2018-04-11 15:13 ` 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=CAKPH-NiKO+HA6M2GV3VGuh_FhSYSN6NHLVrU_8RsSKFdQCOvXA@mail.gmail.com \
    --to=mirela.simonovic@aggios.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dm@aggios.com \
    --cc=edgar.iglesias@xilinx.com \
    --cc=julien.grall@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xen.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.