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

Re: [PATCH 14/37] xen/x86: use name fw_numa to replace acpi_numa


  • To: Wei Chen <wei.chen@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 25 Jan 2022 11:12:59 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=S2nglaKedNhjEXl/TXRE9njFgiXWIGDGR89CVPZ6Y2c=; b=DL+g3hwWEiDFB331yR8lXVVW6SMm1+a+aN3+7d/mq0FOLOH5SVLnC5jkVyY+aUdq2zGruo/PoXD5L17vKM5eEv8DGY2MVtkRmQRc+gYacSa3iS8p6supCuHLdVpCiL4gWgzvR+6F0irOa5ONm4+qX4M2W6mCnkzuuyYgzBg++JBZY8KQ2wdAUyuopZnR4NON1SgxgQBMaJEGiJgnN/9u2A62Wihy6vivkPZD+mB0FF4RtivzBXfJmLfDeb2HOg04eyRkml0ZJ7iz2f6bPVJVUe0KXa5GiCZQSdqDm7u7yyivJEatxiCpcUS8NWKH1C6XhKp+MLLNpEilmvXFCkX/xQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cQAIGOyMBfDd110EPTtlNsqfYan5WQBERd9+Esco97tTEzYw3IE2+cpkm0eLY24d0TYZbtJT9Dy3BzproNktUqQ3AN8K/8ICDyENJFuxe3ColCXt2FoSbiIKDmCF5vMUIiGNrosacHW41rLqSISH0hJHTvNpTKUsdYd1ZhkVHR8LK/Me1SJepVMezn7QG/EXtl/WvgXIFiiHUhNRQ4Y0+DzDFgZwBRrdSZu7KrToZ98hUgkhTfPgfOBOU1U69SENvJG0peUQU1MMAnnnodb4tYSJOtvHqF9BOheKzOA1v94LkABaAuE5jFursw4FVtvekJFWfei4kphAT5s/r5ZmAQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Bertrand.Marquis@xxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, sstabellini@xxxxxxxxxx, julien@xxxxxxx
  • Delivery-date: Tue, 25 Jan 2022 10:13:14 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 23.09.2021 14:02, Wei Chen wrote:
> --- a/xen/arch/x86/numa.c
> +++ b/xen/arch/x86/numa.c
> @@ -51,11 +51,11 @@ cpumask_t node_to_cpumask[MAX_NUMNODES] __read_mostly;
>  nodemask_t __read_mostly node_online_map = { { [0] = 1UL } };
>  
>  bool numa_off;
> -s8 acpi_numa = 0;
> +s8 fw_numa = 0;

In x86 code I'd prefer this to remain "acpi_numa". If you need to access
the variable from to-become-generic code, introduce an inline wrapper
(possibly named numa_mode()), allowing you to do whatever you need in the
DT case. It may be helpful to fold this with numa_off then, seeing e.g.
...

>  int srat_disabled(void)
>  {
> -    return numa_off || acpi_numa < 0;
> +    return numa_off || fw_numa < 0;

... this. Actually I think the underlying enumeration could even be made
generic:

enum numa_mode {
    numa_off,
    numa_on,
    numa_acpi,
};

is, I believe, sufficient to express the present (numa_off,acpi_numa)
tuple. In this context I'd like to point out that the two uses of
acpi_numa in srat_parse_regions() and srat_detect_node() should likely
be invocations of srat_disabled() instead, to also take numa_off into
account. This would then be addressed effectively as a side effect by
replacing open-coded uses as well as srat_disabled() by numa_mode() (or
whichever name the new helper would gain).

Jan




 


Rackspace

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