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

RE: [PATCH v4 09/17] xen/arm: introduce a helper to parse device tree NUMA distance map


  • To: Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • From: Henry Wang <Henry.Wang@xxxxxxx>
  • Date: Wed, 26 Apr 2023 07:08:56 +0000
  • Accept-language: zh-CN, en-US
  • 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=0GUU/m+xsfVYzT9TWT2PAJ1kjugLJkqjWPwsCs1aqwg=; b=eRoZDKIo+CO0FFxzGGgWZ4wVTRT5VbVoJWvmfKaTI8b/Ha98boqcXHKbGl9hdysNA3CgTcFHwlBiUTUcLvOiw1sxZPfNIZdJaY9MntYy/Pa78dk/NBbcn/LVwrBS60HY50gTKbv7/y2tNBPLYSXtpsORzy6PlXdoseola9VCPpre8LDragVsmawcR5kBuFKL1CoqJ7EDYZP/YemChHJC87J3c35pOLiPCLiCBAErAL+fHdvzTLOCzpE466ZOiqn6i3yhgPKOfhSa2u0a1b/HNHirahH/WmFDQUT7muGnzgCk4lFQ0QtkkQGx8uLR8KkQYmVcI315Ip6nqGH+grz43w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dgv+dYJvbU94aOUiAG4ycwk0vTZfSzsvfKxEhC4vxKCVyCblzsvp7mUGmg5UOoVf4P122jk8yHRgQZJW09IjsTt0tKhhjBFitHyDDfXtt8+FFBlioExPFfmXcKLzFQpSPwj397r3C8VsNjF/a5r7bVdaZjmW/SkizCJ2Xtp7WWlwAuyTuYCut+/y9Xl4ZyTMMyG6FKPVLW6iSIquk2gBDSBXo0et2DxNeTjG49wrgp5enZMxVj+aw2MdgwpXE30YmNksDcTilm+tB88DsX6iUtJafbRBxTTQvJ0xneTV9hQpoA/J2SAruU/tMIOoJgTesHBkbAzlestvVua1SdK/Cw==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Wei Chen <Wei.Chen@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 26 Apr 2023 07:09:32 +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;
  • Thread-index: AQHZd0ulMpqFICe/LUiDVq6+aDsW9687sveAgAFTkCCAACNagIAAAPgg
  • Thread-topic: [PATCH v4 09/17] xen/arm: introduce a helper to parse device tree NUMA distance map

Hi Jan,

> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Subject: Re: [PATCH v4 09/17] xen/arm: introduce a helper to parse device
> tree NUMA distance map
> 
> On 26.04.2023 07:33, Henry Wang wrote:
> >> -----Original Message-----
> >> From: Jan Beulich <jbeulich@xxxxxxxx>
> >>
> >>> +        /* Get opposite way distance */
> >>> +        opposite = __node_distance(to, from);
> >>> +        /* The default value in node_distance_map is
> NUMA_NO_DISTANCE
> >> */
> >>> +        if ( opposite == NUMA_NO_DISTANCE )
> >>
> >> And the matrix you're reading from can't hold NUMA_NO_DISTANCE
> entries?
> >> I ask because you don't check this above; you only check against
> >> NUMA_LOCAL_DISTANCE.
> >
> > My understanding for the purpose of this part of code is to check if the
> opposite
> > way distance has already been set, so we need to compare the opposite
> way
> > distance with the default value NUMA_NO_DISTANCE here.
> >
> > Back to your question, I can see your point of the question. However I don't
> think
> > NUMA_NO_DISTANCE is a valid value to describe the node distance in the
> device
> > tree. This is because I hunted down the previous discussions and found [2]
> about
> > we should try to keep consistent between the value used in device tree and
> ACPI
> > tables. From the ACPI spec, 0xFF, i.e. NUMA_NO_DISTANCE means
> unreachable.
> > I think this is also the reason why NUMA_NO_DISTANCE can be used as the
> default
> > value of the distance map, otherwise we won't have any value to use.
> 
> The [2] link you provided discusses NUMA_LOCAL_DISTANCE.

I inferred the discussion as "we should try to keep consistent between the value
used in device tree and ACPI tables". Maybe my inference is wrong.

> Looking at
> Linux'es Documentation/devicetree/numa.txt, there's no mention of an
> upper bound on the distance values. It only says that on the diagonal
> entries should be 10 (i.e. matching ACPI, without really saying so).

I agree that the NUMA device tree binding is a little bit vague. So I cannot
say the case that you provided is not valid. I would like to ask Arm maintainers
(putting them into To:) opinion on this as I think I am not the one to decide 
the
expected behavior on Arm.

Bertrand/Julien/Stefano: Would you please kindly share your opinion on which
value should be used as the default value of the node distance map? Do you
think reusing the "unreachable" distance, i.e. 0xFF, as the default node 
distance
is acceptable here? Thanks!

Kind regards,
Henry

> 
> Jan

 


Rackspace

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