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

Re: [PATCH v2 03/17] xen/arm: implement node distance helpers for Arm


  • To: Julien Grall <julien@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • From: Wei Chen <Wei.Chen@xxxxxxx>
  • Date: Mon, 16 Jan 2023 17:40:25 +0800
  • 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=L3P0XiTgynu573SmPp/QcDNdyG9IX1u1LFbgNqKMTuk=; b=O5fXeLUxfe98qze6nxd3XiWgkskLKoieuosYgZ71kXkDS2F2SHqiSU6b/689/GZAHWRqjcdmOOIkUezXnTZGBZZN4zysKND+xovi0aMLFPOC0esdRcGJ7jbGAmCg+UKBusHSicVnZipXPZVq11hAKDUUjrWlbU/Xjwocty9iFYLuxe58uGd5GPTqDBj4sMBuFgXDLKxQO93897hoyXuwTapHVqjzyFB/2d6QoNlGoUQ4uViS1oomnKXVIdrlx2V7cpt9WKIuMA1B4FY0a51ByvhJgi31vHpS08l4rY9cPLEC4rK8owa5Misrz4yI/eikeR+nlmJ6QipasC0kGdfOqA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J3cKJAPnltdFeqOexwNHHhz/ONeUhf1TpKDTLaGEuHaOea5CVlp91sMiTO0PK9KHUAF1np96F5wrRBwIfn4hkPc6g49NBdVloQlPUPLKVn7/JUGnk9+6FsX14Xp2vRogt7S7rmBBGFnqvXtMdy1bbVWJZ2xaoMjNi+s/5oRsbIiHiYo7PHDdAFAy6qDFLA8Ox0JDdpGIiTeCGVBRNQcNF/At+Z4AnKkWWAnwAUPO5cMk2YBT20opoaa1ooVkmctStBnRkY+GOHQ/EqKbHFqrimamek4iLCjx69ftUWqSXFIq8EgV6LL5H0RRD9Im+EkwdU2cK/6M27eYkzbRSxD9Bg==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: nd <nd@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 16 Jan 2023 09:41:12 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;

Hi Julien,

On 2023/1/12 17:47, Julien Grall wrote:
Hi,

On 12/01/2023 08:11, Jan Beulich wrote:
On 12.01.2023 07:31, Wei Chen wrote:
-----Original Message-----
From: Jan Beulich <jbeulich@xxxxxxxx>
Sent: 2023年1月11日 0:47

On 10.01.2023 09:49, Wei Chen wrote:
--- a/xen/arch/arm/include/asm/numa.h
+++ b/xen/arch/arm/include/asm/numa.h
@@ -28,6 +28,20 @@ enum dt_numa_status {
      DT_NUMA_OFF,
  };

+/*
+ * In ACPI spec, 0-9 are the reserved values for node distance,
+ * 10 indicates local node distance, 20 indicates remote node
+ * distance. Set node distance map in device tree will follow
+ * the ACPI's definition.

Looking at the ACPI spec, I agree that the local node distance is defined to 10. But I couldn't find any mention of the value 20.

How is NUMA_REMOTE_DISTANCE is meant to be used? Is this a default value? If so, maybe we should add "DEFAULT" in the name.


I think you're right, maybe we can rename NUMA_REMOTE_DISTANCE
to NUMA_DEFAULT_DISTANCE.Different pairs of nodes may have different remote distance values, I can not define one value for them.

And why use 20 as default value, I have followed the ACPI's logic.
In ACPI NUMA, when ACPI doesn't provide SLIT table, 20 will be used
for all nodes default distance.

+ */
+#define NUMA_DISTANCE_UDF_MIN   0
+#define NUMA_DISTANCE_UDF_MAX   9
+#define NUMA_LOCAL_DISTANCE     10
+#define NUMA_REMOTE_DISTANCE    20

In the absence of a caller of numa_set_distance() it is entirely unclear
whether this tying to ACPI used values is actually appropriate.


 From Kernel's NUMA device tree binding, it seems DT NUMA are reusing
ACPI used values for distances [1].

I can't find any mention of ACPI in that doc, so the example values used
there matching ACPI's may also be coincidental. In no event can a Linux
kernel doc serve as DT specification.

The directory Documentation/devicetree is the de-facto place where all the bindings are described. This is used by most (to not say all) users.

I vaguely remember there were plan in the past to move the bindings out of the kernel. But it looks like this has not been done. Yet, they tend to be reviewed independently from the kernel.

So, as Wei pointed, if we don't follow them then we will not be able to re-use Device-Tree shipped.

If values are to match ACPI's, I
expect a DT spec to actually say so.
I don't think it is necessary to say that. Bindings are not meant to change and a developer can rely on the local distance value to not change with the current bindings.

So IMHO, it is OK to assume that the local distance value is the same between ACPI and DT. That would definitely simplify the parsing and code.


Thanks for clarifying this.

Cheers,
Wei Chen

Cheers,




 


Rackspace

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