[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 1/2] xen/link: Introduce .bss.percpu.page_aligned


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <JBeulich@xxxxxxxx>
  • Date: Fri, 26 Jul 2019 14:38:34 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=suse.com;dmarc=pass action=none header.from=suse.com;dkim=pass header.d=suse.com;arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hJ/Yk1GSlZmw3cnw6jyc8+xAMvhQsen0pcvwE57TYPU=; b=S847JxmbVuHpm52S7ce7q+SW25rkSFVej2GIfyd8GenQA/m6GqZwUNtNoxnobh67owTiK6lWs5hWxwP7mzu8xt6vq1seIDr4SxyeXMw+GyY2kjkluenTC4lbfwUOHwrCiX4WkVHQotdFAIVx/GG+oro0cnJwlQkdukaJ9ebR7QmGDJAwttW2UR0V9nY5LTdlwDomhpkb8wCih1Kx7WKjPkhjK3gNNcIlE/lbhes65REG5s343DdF5aJXrRCazoLhuo9VatBj+aqEjZMYGj4B+mTywWIBhKPLrhzYkVazTFT6O3PPouwlViv120Y159789jc3Esm8yZfV29SEGnpVkA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oCD0rZGuJyrqO35YdTqpozgvFU+9LcBZ3PUI8vqC9Z+xWUHLF3A0DSqei9/RFu0QvgFg0wK/0TtC9ENLdUWLcBLStuwfPn2aHGeHj8JQQHC7FoHqoatJAyVHIjExWjYmyPJa3Rr+/TNzDk/k+DlZuyarwK/W6FdKwvuJHQqcHF3d7qF6vdup3bDjmZ58v1RWGbYBsJIhCQ/TdL811NrqVZIAI4C6rAXqfFaf318wp1cBRoHjATzzJYUhy+iRdx4t7EdAK1EWx+v9IOOZGuBDTTSC1+QuXP4oa4zLBCQJEY1KqQevCR5vHuGTNsTUJBjByQWvvhqdaX/IL18IJfenfQ==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=JBeulich@xxxxxxxx;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Julien Grall <julien.grall@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, VolodymyrBabchuk <Volodymyr_Babchuk@xxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Fri, 26 Jul 2019 14:43:28 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVQ7mbx1nPtP170EKn0DeicB+T7Kbc89sCgAACKTaAAAIcAA==
  • Thread-topic: [PATCH 1/2] xen/link: Introduce .bss.percpu.page_aligned

On 26.07.2019 16:30, Andrew Cooper wrote:
> On 26/07/2019 15:22, Roger Pau Monné wrote:
>> On Fri, Jul 26, 2019 at 02:52:39PM +0100, Andrew Cooper wrote:
>>> Future changes are going to need to page align some percpu data.
>>>
>>> This means that the percpu area needs suiably aligning in the BSS so CPU0 
>>> has
>>> correctly aligned data.  Shuffle the exact link order of items within the 
>>> BSS
>>> to give .bss.percpu.page_aligned appropriate alignment.
>>>
>>> Additionally, introduce DEFINE_PER_CPU_PAGE_ALIGNED()
>>>
>>> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
>>> ---
>>> CC: Jan Beulich <JBeulich@xxxxxxxx>
>>> CC: Wei Liu <wl@xxxxxxx>
>>> CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
>>> CC: Stefano Stabellini <sstabellini@xxxxxxxxxx>
>>> CC: Julien Grall <julien.grall@xxxxxxx>
>>> CC: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
>>> ---
>>>   xen/arch/arm/xen.lds.S   | 5 +++--
>>>   xen/arch/x86/xen.lds.S   | 5 +++--
>>>   xen/include/xen/percpu.h | 2 ++
>>>   3 files changed, 8 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
>>> index 12c107f45d..07cbdf2543 100644
>>> --- a/xen/arch/arm/xen.lds.S
>>> +++ b/xen/arch/arm/xen.lds.S
>>> @@ -201,14 +201,15 @@ SECTIONS
>>>          *(.bss.stack_aligned)
>>>          . = ALIGN(PAGE_SIZE);
>>>          *(.bss.page_aligned)
>>> -       *(.bss)
>>> -       . = ALIGN(SMP_CACHE_BYTES);
>> Don't you also need a:
>>
>> . = ALIGN(PAGE_SIZE);
>>
>> here?
> 
> No, (I don't think so).
> 
>> Or is the size of .bss.page_aligned also aligned to page size?
> 
> Every object inside .bss.page_aligned should have suitable (i.e.
> multiple of) size and alignment.  Without this, things will break.

I'm not sure we should have such a requirement: Objects in
.*.page_aligned sections should themselves have PAGE_SIZE alignment
(i.e. there shouldn't be a need to ALIGN() _ahead_ of the section
directive in the script (that is, the one in context above should
actually be redundant). But I'm not sure about demanding their
size to be a multiple of PAGE_SIZE - while C will guarantee this
(and waste space in certain cases), assembly constructs could still
be written such that the trailing unused space can be re-used. Otoh
I agree with your virtual statement of this being a little fragile.

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.