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

RE: [XEN RFC PATCH 37/40] xen: introduce an arch helper to do NUMA init failed fallback


  • To: Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • From: Wei Chen <Wei.Chen@xxxxxxx>
  • Date: Sat, 28 Aug 2021 03:09:20 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.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=GxBj5NEtDofLk2BxzJ/Y4p8Tdg16B/3aUZNZZs3kTvI=; b=I3vey6slbuNl7JVfvKp/U6H/0l4EWv8P5h3LRlkxxtCV2c9yX00jRKY3dM3hCaUIWP8774iwgvnBErt/1tewD/TRWSZ9iXHmGCrDZggAsCbReIOR/ONCX8mddMR24KuOeunuME5PRF2zQJpg6n5iZz1GZych6dtu6RLEGVcROfBK4NsLqpuJg5RF37MHuKQ0ZVjZEalARoUTr0aTJ6oQsGuLEM9bfE8R/nWgs5uR5ZL7IUx/cOT7sVKCjDFGWEe2rwHM8fdGsUP14+csm+tp5Fp/OXFtH/xpnIIzDvv/+CYtO9ZzwSMaA87WcoJagQJeeUp5uPj+wiZ8MpCRgkhPzQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ccP34FgSL6a0zVLRSFAlbt+DdNde/IDeL+Hmyp7heASBvtNJDAwLB4Fy4JC9BreIp9EgPAQ23iyg2RCXsc7DT8/DKQqRpB9iW7D0I0czY4SpJnUhxWypfSPz0OmMSiJ0XpwVJYQDfU7lyi6hJRGLJBzuywLGjZZcRwrMFd13ZORJShOWMsNslEJhOXbyYJ1P2k67+dMwkB8eDRyn8Qv0jCN7sRvveLgzIYA1BXclL+5dHGiUUfrMNJxIZqXX4tqewcRbq+H4Cgq62NEuxL3VolF3jA4EEGp3YG/84IPX4x22tcF6IydQjEdyC8UUTrd52XJrn9nAZ0VfvalYQFOWFg==
  • Authentication-results-original: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Cc: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Delivery-date: Sat, 28 Aug 2021 03:09:40 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHXjptRsfRkXW8NoUWuJvdR0xpL2KuHguqAgADGK1A=
  • Thread-topic: [XEN RFC PATCH 37/40] xen: introduce an arch helper to do NUMA init failed fallback

Hi Julien,

> -----Original Message-----
> From: Julien Grall <julien@xxxxxxx>
> Sent: 2021年8月27日 22:30
> To: Wei Chen <Wei.Chen@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx;
> sstabellini@xxxxxxxxxx; jbeulich@xxxxxxxx
> Cc: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
> Subject: Re: [XEN RFC PATCH 37/40] xen: introduce an arch helper to do
> NUMA init failed fallback
> 
> Hi,
> 
> On 11/08/2021 11:24, Wei Chen wrote:
> > When Xen initialize NUMA failed, some architectures may need to
> > do fallback actions. For example, in device tree based NUMA, Arm
> > need to reset the distance between any two nodes.
> 
>  From the description here, I don't understand why we need to reset the
> distance for Arm but not x86. In fact...
> 
> >
> > Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
> > ---
> >   xen/arch/arm/numa.c        | 13 +++++++++++++
> >   xen/common/numa.c          |  3 +++
> >   xen/include/asm-arm/numa.h |  1 +
> >   xen/include/asm-x86/numa.h |  6 ++++++
> >   4 files changed, 23 insertions(+)
> >
> > diff --git a/xen/arch/arm/numa.c b/xen/arch/arm/numa.c
> > index 6eebf8e8bc..2a18c97470 100644
> > --- a/xen/arch/arm/numa.c
> > +++ b/xen/arch/arm/numa.c
> > @@ -140,3 +140,16 @@ int __init arch_meminfo_get_ram_bank_range(int bank,
> >
> >     return 0;
> >   }
> > +
> > +void __init arch_numa_init_failed_fallback(void)
> > +{
> > +    int i, j;
> > +
> > +    /* Reset all node distance to remote_distance */
> > +    for ( i = 0; i < MAX_NUMNODES; i++ ) {
> > +        for ( j = 0; j < MAX_NUMNODES; j++ ) {
> > +            numa_set_distance(i, j,
> > +                (i == j) ? NUMA_LOCAL_DISTANCE : NUMA_REMOTE_DISTANCE);
> > +        }
> > +    }
> > +}
> 
> ... this implementation looks fairly generic. So can you explain why we
> need it on Arm but not x86?
> 

This implementation is DT only, for x86, it's using acpi_slit.
For now, I am not quit sure ACPI need to do fallback or not.
Or say in another way, I don't know how to implement the fallback
for ACPI. I planned to solve it in Arm ACPI version NUMA, so I left
an empty helper for x86.

@Jan Beulich Could you give me some suggestion about x86 fallback?


> > diff --git a/xen/common/numa.c b/xen/common/numa.c
> > index d15c2fc311..88f1594127 100644
> > --- a/xen/common/numa.c
> > +++ b/xen/common/numa.c
> > @@ -405,4 +405,7 @@ void __init numa_initmem_init(unsigned long
> start_pfn, unsigned long end_pfn)
> >       cpumask_copy(&node_to_cpumask[0], cpumask_of(0));
> >       setup_node_bootmem(0, (u64)start_pfn << PAGE_SHIFT,
> >                       (u64)end_pfn << PAGE_SHIFT);
> > +
> > +    /* architecture specified fallback operations */
> > +    arch_numa_init_failed_fallback();
> >   }
> > diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h
> > index dd31324b0b..a3982a94b6 100644
> > --- a/xen/include/asm-arm/numa.h
> > +++ b/xen/include/asm-arm/numa.h
> > @@ -28,6 +28,7 @@ extern s8 device_tree_numa;
> >   extern void numa_init(bool acpi_off);
> >   extern int numa_device_tree_init(const void *fdt);
> >   extern void numa_set_distance(nodeid_t from, nodeid_t to, uint32_t
> distance);
> > +extern void arch_numa_init_failed_fallback(void);
> >
> >   /*
> >    * Temporary for fake NUMA node, when CPU, memory and distance
> > diff --git a/xen/include/asm-x86/numa.h b/xen/include/asm-x86/numa.h
> > index e63869135c..26280b0f3a 100644
> > --- a/xen/include/asm-x86/numa.h
> > +++ b/xen/include/asm-x86/numa.h
> > @@ -22,4 +22,10 @@ extern void init_cpu_to_node(void);
> >   void srat_parse_regions(u64 addr);
> >   unsigned int arch_get_dma_bitsize(void);
> >
> > +/* Dummy function for numa init failed in numa_initmem_init */
> > +static inline void arch_numa_init_failed_fallback(void)
> > +{
> > +    return;
> 
> NIT: The return is pointless.
> 

OK

> > +}
> > +
> >   #endif
> >
> 
> Cheers,
> 
> --
> Julien Grall

 


Rackspace

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