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

RE: [XEN RFC PATCH 16/40] xen/arm: Create a fake NUMA node to use common code


  • To: Jan Beulich <jbeulich@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Wei Chen <Wei.Chen@xxxxxxx>
  • Date: Fri, 27 Aug 2021 09:32:27 +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=QhHzuM2N/wB4YDWf2eQFPUVE3bdYEyq3wCGDGBrPG8M=; b=bUw/YAzmYX9AMpuvnCtySatECOpm+kMth2qXiwYDb8U89IJcKqHx9ymFxIr9MxkkB4sf0PhhJCyN0Kv2Ndulg4pW7pkDWM44EcHfHB5fLZYyNQ85v3gWdf44t9YHDNWxefZ3Ul774BXDyuz6sEaWCrKqK15rrYs5tA9/2bcZK2RAC0H2aBZ4mG6+7IZdr7nl1SvLLnsMsveBEMO5Qq9TdekQMy0HiqdyfVX5QEDPUtbLK3y/7oie17+o0tnIl0z5A7gHGfmGaZ1GPin/ORo+8x34ummZxdh/XSvVMrEs8ZDOTFB0PXNaSTOVni/x1jU95n4xxscKsbIoL9Q5cqi4ng==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cJ4xjOgD59OnR+lDmfaAAmAeDyswbrMZOV8eE/oNr2g4r4vNjsiLfCJmF1CpSzGy+LO+u/Y1GSpmG40BsY57FDHQhJfRqYf02MY28AgUxAa5m/hFlcxNRQPYp7vijlvpb9Yjpy8DssiM+unqWFadbUZPhFUSvlhg/iCxXfiwgCkIK+gKARm+QgYOpCinM5aSN5NUvrY9sNkB4mptgw+C+FBzYiJ3fVmu2A0uEoKTUQHEQSZQrYBjnc69Y8CwTTumC7n/rFNk2019AIiZjYi40mJGWY4ekVrBLcZ8HWN5Y3JnX2ngcG+yuM6doXrKmLFgkwSJ8ufBAAQDi0CEayYzwA==
  • Authentication-results-original: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=arm.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "julien@xxxxxxx" <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Delivery-date: Fri, 27 Aug 2021 09:32:43 +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: AQHXjps2iDGXvfLaHUqc/mpIlhQB9auGgcmAgAB3swCAADX9oA==
  • Thread-topic: [XEN RFC PATCH 16/40] xen/arm: Create a fake NUMA node to use common code

Hi Jan,

> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: 2021年8月27日 14:18
> To: Stefano Stabellini <sstabellini@xxxxxxxxxx>; Wei Chen
> <Wei.Chen@xxxxxxx>
> Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx; julien@xxxxxxx; Bertrand Marquis
> <Bertrand.Marquis@xxxxxxx>
> Subject: Re: [XEN RFC PATCH 16/40] xen/arm: Create a fake NUMA node to use
> common code
> 
> On 27.08.2021 01:10, Stefano Stabellini wrote:
> > On Wed, 11 Aug 2021, Wei Chen wrote:
> >> @@ -29,3 +31,54 @@ void numa_set_node(int cpu, nodeid_t nid)
> >>
> >>      cpu_to_node[cpu] = nid;
> >>  }
> >> +
> >> +void __init numa_init(bool acpi_off)
> >> +{
> >> +    uint32_t idx;
> >> +    paddr_t ram_start = ~0;
> >> +    paddr_t ram_size = 0;
> >> +    paddr_t ram_end = 0;
> >> +
> >> +    printk(XENLOG_WARNING
> >> +        "NUMA has not been supported yet, NUMA off!\n");
> >
> > NIT: please align
> >
> >
> >> +    /* Arm NUMA has not been implemented until this patch */
> >
> > "Arm NUMA is not implemented yet"
> >
> >
> >> +    numa_off = true;
> >> +
> >> +    /*
> >> +     * Set all cpu_to_node mapping to 0, this will make cpu_to_node
> >> +     * function return 0 as previous fake cpu_to_node API.
> >> +     */
> >> +    for ( idx = 0; idx < NR_CPUS; idx++ )
> >> +        cpu_to_node[idx] = 0;
> >> +
> >> +    /*
> >> +     * Make node_to_cpumask, node_spanned_pages and node_start_pfn
> >> +     * return as previous fake APIs.
> >> +     */
> >> +    for ( idx = 0; idx < MAX_NUMNODES; idx++ ) {
> >> +        node_to_cpumask[idx] = cpu_online_map;
> >> +        node_spanned_pages(idx) = (max_page - mfn_x(first_valid_mfn));
> >> +        node_start_pfn(idx) = (mfn_x(first_valid_mfn));
> >> +    }
> >
> > I just want to note that this works because MAX_NUMNODES is 1. If
> > MAX_NUMNODES was > 1 then it would be wrong to set node_to_cpumask,
> > node_spanned_pages and node_start_pfn for all nodes to the same values.
> >
> > It might be worth writing something about it in the in-code comment.
> 
> Plus perhaps BUILD_BUG_ON(MAX_NUMNODES != 1), so the issue is actually
> noticed at build time once the constant gets changed?
> 

It would be better. I will use it in next version.

> Jan


 


Rackspace

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