[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 5/6] xen/x86: move NUMA scan nodes codes from x86 to common
- To: Wei Chen <wei.chen@xxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Tue, 27 Sep 2022 17:48:58 +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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0AOXUC96VkhsXa8dWhvMF0s+t1yabiRdQ4QW+0xtGSQ=; b=G9VVSI/9N2oucWBEa3iwpRQbBUVvve48cW/qP5h+5VSuTGwl469j+bDOi3MWD94Co38ME6xls3hwrPfOWcQzzZvxN6A1AFirh7jqTT2YDDO3PvsWycIMgnr/C+x1l93YR32fsY/mCTjybmyUC+g6rTWfKGOZYu3L7JCK/aOgkv8B3QLbM/Tu09rwB5OU7SNgz8Z1m9IHXABd+FTon/fR8HWc2JwYBIcTbDeDR0q8gmTYTuU1BIoJ3q549VRqtoh62z/0vdWC1jndrM/ROyTOee5mfCx0+qRxbjDpJXGyyyCixTpYho50cLrLVtYNVJdCCUH7GfmweEzdSJ0KNRg7eQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e0xJC0mv7k2I5LilK/pQQDbFBLzkJK+EkJOIIzXNnvqrT8y/d6bqbs7iLuorsGgozY4u0GV4WZub+hYymrsjhVm+B0ACLK3pmc4NQeyozV88TCn5rGtHfYgdOGGkW0I/wQg6dap1/raBn8cdxwFjLtqvPl/w+tByaUIkGOAEt1hcx+dMLaHkjmYZxuM56ZUYkFdLnN14RSWXLziKnggHZGMm4rVTmOHTPdxV/Oql/i/h/wI/RTEr5dL8hUBYSPnlns4C82/QptYbyolmQFFu7uSBwGJG26mCdfJEO7KsU0ff8K5idhfJfH4ZK+JeZAqMCWLXQZPFpeZzpusSIbfz5g==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: nd@xxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Tue, 27 Sep 2022 15:49:03 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 20.09.2022 11:12, Wei Chen wrote:
> +static bool __init nodes_cover_memory(void)
> +{
> + unsigned int i;
> +
> + for ( i = 0; ; i++ )
> + {
> + int err;
> + bool found;
> + unsigned int j;
> + paddr_t start, end;
> +
> + /* Try to loop memory map from index 0 to end to get RAM ranges. */
> + err = arch_get_ram_range(i, &start, &end);
> +
> + /* Reached the end of the memory map? */
> + if ( err == -ENOENT )
> + break;
> +
> + /* Skip non-RAM entries. */
> + if ( err )
> + continue;
> +
> + do {
> + found = false;
> + for_each_node_mask ( j, memory_nodes_parsed )
> + if ( start < nodes[j].end
> + && end > nodes[j].start )
Nit: Style (placement of && and indentation). Does this actually need
splitting across two lines?
> --- a/xen/drivers/acpi/Kconfig
> +++ b/xen/drivers/acpi/Kconfig
> @@ -7,4 +7,5 @@ config ACPI_LEGACY_TABLES_LOOKUP
>
> config ACPI_NUMA
> bool
> + select HAS_NUMA_NODE_FWID
> select NUMA
While I might guess that you've chosen the insertion point to have
things sorted alphabetically, I think here it would be more natural
to select the wider option first and then also select the more
narrow one.
One further question though: How is this going to work for Arm64
once it wants to support both the form of NUMA you're working to
enable _and_ ACPI-based NUMA? There better wouldn't be a requirement
to pick one of the two at build time - it would be nice for support
of both forms to be able to co-exist in a single binary.
Jan
|