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

Re: [PATCH v3 1/6] xen/x86: Provide helpers for common code to access acpi_numa


  • To: Wei Chen <wei.chen@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 25 Aug 2022 12:18:21 +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=2TO/Wkl9OWTNErk2uogj+5BpYOVrbr1YzUDiHC8McFM=; b=TGKow0jEWzvaDSPmuttNIi9es3t4KX0OmZ4I2Gb7LVAYwZ7le8nLhimWcn64AGsXT+NLSC/Klg+SqkDJDcTbS4MoXHT4ClGa3Nfhosi+GrGT15EpbX/o9C8IrtUtFyYWp3ooWN2A/LmSpYn9L3Tr9z/V/Khbc16q1jOK5Zo1TpSRPvufZr+oOfnfcA14pyGX5SdLpHXMBDLxU/EoSnQrIkwMpq+tgLFLst589EIlR8eIJ+9GKreyyFDdJbQc5KMIftFVz5MNPGDVVIUFwgoS2OJlhgjj4eZdULf+iReZmLi3FwXXKtaW8SB5j7hshrm+T2AiljEAzOrHiR7vL+D57A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b7klRiHomUrrkXe402LUPnh67//x7FXTdI6S+uGCXkH//lyw7a4FDYbcOkYhKUN+xZzwe7wMJT/Z2yJinBbutDtAHjcpNduHMB30h/0inM83c1LnZtc6NaMjLWhjVvLf1G24GJqc6doHw28MC8PJkLcdvgrGmt/MaMDzNlKXddypo/NNDB02EtZWOJwvBsbjp+GgBd10RkjB7HR52qlQb/XCoV1t4KdUpiKAO71sNJmrDgOghPBzqj6tH49tiSwYMsXIs5UuB0qYPwfVKbzYnlZRQUOsk35TPMClB/+T5gB5WYN3tNc41S0msWledW8qtN0aUkNDMzPQVwX7y+Jteg==
  • 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>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 25 Aug 2022 10:18:29 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 22.08.2022 04:58, Wei Chen wrote:
> --- a/xen/arch/x86/include/asm/numa.h
> +++ b/xen/arch/x86/include/asm/numa.h
> @@ -32,8 +32,9 @@ extern void numa_add_cpu(int cpu);
>  extern void numa_init_array(void);
>  extern bool numa_off;
>  
> -
> -extern int srat_disabled(void);
> +extern int arch_numa_setup(const char *opt);
> +extern bool arch_numa_disabled(bool init_as_disable);

What is the parameter name intended to mean? Since the only caller
passes "false", this also isn't really possible to guess from the
use(s) in this patch. In any event perhaps best for the parameter
to be introduced only once it's actually needed.

> --- a/xen/arch/x86/numa.c
> +++ b/xen/arch/x86/numa.c
> @@ -50,9 +50,31 @@ nodemask_t __read_mostly node_online_map = { { [0] = 1UL } 
> };
>  bool numa_off;
>  s8 acpi_numa = 0;
>  
> -int srat_disabled(void)
> +int __init arch_numa_setup(const char *opt)
>  {
> -    return numa_off || acpi_numa < 0;
> +#ifdef CONFIG_ACPI_NUMA
> +    if ( !strncmp(opt, "noacpi", 6) )
> +    {
> +        numa_off = false;
> +        acpi_numa = -1;
> +        return 0;

With this "return" ...

> +    }
> +    else

... this "else" is unnecessary and hence would better be dropped,
not the least to ...

> +#endif
> +    return -EINVAL;

... avoid the otherwise ambiguous indentation of this line.

Jan



 


Rackspace

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