[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: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Wei Chen <Wei.Chen@xxxxxxx>
  • Date: Mon, 30 Aug 2021 10:38:16 +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=CQ5nW/huXgSWIRuHlwC1CbbuYHMGL9+q2u3Sgcn15UI=; b=kfJ6W1+D/v6BpDjalwIpbWb/Z7DXV8/Pj9oZStDSyeNbeO2vEP/4VB26rPkI5fmuUmltlYex+4mNyacNDbQNe6+uZ4kKXUWwmMORuthdla93gT1i2pjDLRhhUdtbrF5ZB2IOYygIoAngRU3CWjBQ0zpKZ0iODYWZIuZ0MpJ2mM3UnLAAkbq9W5AofFywMhh4xmM3PSDgn/WkoLJQK7gPb8L1LRRF517AZ50DNFewMkwz5tT6VkzwL6Kmt1IsSHWhY4z8FomLoHwQXNZgXV5esnZJh58Mv7/zKx/QdP/pRFABbnq4VACNzzJbfngknm6kyP73Bi79jLdVChX6S5jKLA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GpQjdbRF1PcZHtBKRAPGh35R+5ynMcqY6s58t5ykqnojpODOYUdkzmD+zt+tl3jhl+kaPZjjYsm6ngE/Uoef1pwauZ9/Hy9S/ouSQ+Rn2xtzYw50uCPEmFTId+MnVjBIvI9Paq+5fGHYSXvn+YoECVR8Ni05fb1zDp+wpZNlmSypcRqCm/X1ZCfWCt0tOqyo6xO7zMnMcTwr8rOFnwJFgxpduSTqPgZdWY00OHtBUw3g73LfiNUr65d0o2JN+8ySVLRcCm24c4CK1sb3PNpdgB8uSb/bQZyVbqcLUpt99mnwtczB8MWTmA/IcxGIJEfPShykFLURabnKTlIZaLsxmw==
  • Authentication-results-original: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=arm.com;
  • Cc: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>
  • Delivery-date: Mon, 30 Aug 2021 10:38:41 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHXjptRsfRkXW8NoUWuJvdR0xpL2KuHguqAgADGK1CAABeL8IADi6MAgAAJadA=
  • Thread-topic: [XEN RFC PATCH 37/40] xen: introduce an arch helper to do NUMA init failed fallback

Hi Jan,

> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: 2021年8月30日 17:52
> To: Wei Chen <Wei.Chen@xxxxxxx>
> Cc: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>; Julien Grall
> <julien@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx; sstabellini@xxxxxxxxxx
> Subject: Re: [XEN RFC PATCH 37/40] xen: introduce an arch helper to do
> NUMA init failed fallback
> 
> On 28.08.2021 05:45, Wei Chen wrote:
> >> From: Xen-devel <xen-devel-bounces@xxxxxxxxxxxxxxxxxxxx> On Behalf Of
> Wei
> >> Chen
> >> Sent: 2021年8月28日 11:09
> >>
> >>> From: Julien Grall <julien@xxxxxxx>
> >>> Sent: 2021年8月27日 22:30
> >>>
> >>>> --- 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?
> >>
> >>
> >
> > I have a quick look into Linux. When Arch do numa init failed,
> > the numa_free_distance will be invoked to revert numa_distance.
> 
> Does this matter in the first place? Don't we fall back to single
> node mode, in which case the sole entry of the distance table
> will say "local" anyway?
> 

Thank you for providing another way of thinking. Yes, once NUMA init
is failed, the system will fall back to single node mode. If we call
__node_distance normally, we will not pass two different nodes to
this function. Even if we don't revert the values in distance table,
we will not trigger the condition of "node_a != node_b". We will
always get "local" from __node_distance.

But for closed-loop of code, I tend to revert data when initialization
is failed.

Cheers,
Wei Chen

> Jan


 


Rackspace

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