[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: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Chen <wei.chen@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 27 Aug 2021 08:18:28 +0200
  • 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=mIOCFS5BCPwQGnE/zvCQb9AN/xmuFqbMtZ4rYAij2wU=; b=U4yAONjaD4Z4HS1NeaIlXgQPXC/YDuE2cWFMwFEaoRTBt3CjZBkPKTSHicq1xFHh7voS8tfErjSN/3RAzKdmTT1AL+RLov3RX6nd04J57w+RGZOLlp81yearntZXoUxVZRVmmIVk+4BL64/U5b9PNGPsZ+ELDSCigqohq5sn66p7yGNxJrzOOMsxv7PeGquX2NtWA/lXWrpHWESSpSxoV/Vt+VmPUHy21KD1k3g30IfatA/xeuWswyaW1VgfwijTpql3seOtSCIWlILc2tZ+ZVpOocnDiv+sLBZJec7dtzAnqJXEcBr+DhwqUQO4aQE9pIjK8eSegrhhANwEFcPg9Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ADaJjYF7mKBULx51dXRuDs2KfE6nTxbmvFUNdf6qv7uyo/wMWJSngG3tBR+ELVyhtoiQGB02kza4gBBxzrF+5AjLC8T+4eyxvBk7b/6QKvgR5sMw8jE2dWXmnXrrpoIuASQyiIxUu6vq2/p6RTeXINM1BLE3YE/YEIhfUvWUkZlR3NCrgrgRHImfuOu/WN071gC2DDOhRteSU62yrf5w41Fhr7tNtz1xRF3Oka7oDJ/YatvhGQsMlWzqcXPrtNINe6Jd5DMORPeY0tZsg2cUpjlyUJhdpZ40lIv+6UjVx6MJNddL412qujFZFpVfWHCg64fLNhdO9VMHl4NcrUC1vQ==
  • Authentication-results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=suse.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, julien@xxxxxxx, Bertrand.Marquis@xxxxxxx
  • Delivery-date: Fri, 27 Aug 2021 06:18:56 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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?

Jan




 


Rackspace

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