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

RE: [XEN RFC PATCH 24/40] xen/arm: introduce a helper to parse device tree NUMA distance map


  • To: Jan Beulich <jbeulich@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Wei Chen <Wei.Chen@xxxxxxx>
  • Date: Thu, 2 Sep 2021 14:14:39 +0000
  • Accept-language: 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-SenderADCheck; bh=JLCyG1nPoAs2Scph3OKb7y5oaPlFomSVrHudFHc5/fc=; b=K5t81NQeQcE4eW9LoZlPFzwAl+zF+zWaQUlcU4tyC3DmP6cW8lxlc7vMBsHAep6UxZMyxmxrdTlFvr3zbadpWPeJ0WVIX7RZdUDfcJAWVRb3Ei1dlgQKqbkj5jWIPuaJRXNDsANM+yfvjLDrYrg8iYwWDKK44/0BM/FmNPtaiGBBIwvkO+sEHzCNyaZIP11zCWfPV+dEJGSJFnFwdePD7AtJ0KeN1LU876miW6WZiXSlkAVk/mKdM/BIGzUGSenEOAtkcqs3ytgs3kFgJrF7vo287RKgTTWU9pwWHUOjQQ7l9QmkOUW8Uv39/0hpI5IpaM70Coma8Uqfj98i8zByoQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=moCUcvJ5s7tImV10RgKRly2fUr3/fPEx/jpYw5FEcq1PjStFa9HTATLx3SIrSalqFdmg6REV89lDkmAKXKq22MG84i0GI37SA/VJAn9JM9MfsZ8zmzDU21my0sZPhNrxjQVv8mvVeRCdoSFuFIgmUPJultXQ6IA8qKXT3+4S4bQ9LmmbaNqY4YxYwgSY6OqKOFB5zgG/slnsNq+wL64g95OtkqS0nuhLVcu1hATExVOgX7hfbBdJC0Qn1bpayQtrLbxGfcBjhrcxDg8HjCAiL5Yi0RKTKjy6dFxuJRZLGvB42OjY0dcP4UQwvDo1PVDEsqs88gVMJUp0RguZmiVFBg==
  • Authentication-results-original: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=arm.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "julien@xxxxxxx" <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Delivery-date: Thu, 02 Sep 2021 14:15:32 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHXjps+iLbrOQu8n06b5z+EtCRt06uM5puAgABnI4CAAPWOAIAA3gOAgABcYACAAOS/gIAAh9fw
  • Thread-topic: [XEN RFC PATCH 24/40] xen/arm: introduce a helper to parse device tree NUMA distance map

Hi Jan,

> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: 2021年9月2日 14:00
> To: Stefano Stabellini <sstabellini@xxxxxxxxxx>; Wei Chen
> <Wei.Chen@xxxxxxx>
> Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx; julien@xxxxxxx; Bertrand Marquis
> <Bertrand.Marquis@xxxxxxx>
> Subject: Re: [XEN RFC PATCH 24/40] xen/arm: introduce a helper to parse
> device tree NUMA distance map
> 
> On 01.09.2021 18:21, Stefano Stabellini wrote:
> > On Wed, 1 Sep 2021, Wei Chen wrote:
> >>> Stefano Stabellini
> >>> Sent: 2021年9月1日 5:36
> >>>
> >>> On Tue, 31 Aug 2021, Wei Chen wrote:
> >>>> I don't really like this implementation. I want the behavior of
> >>>> numa_set_distance just like the function name, do not include
> >>>> implicit operations. Otherwise, except the user read this function
> >>>> implementation before he use it, he probably doesn't know this
> >>>> function has done so many things.
> >>>
> >>> You can leave numa_set_distance as-is without any implicit operations.
> >>>
> >>> In that case, just call numa_set_distance twice from numa_set_distance
> >>> for both from/to and to/from. numa_set_distance could return error is
> >>
> >> I am OK for the first sentence. But...
> >>
> >>> the entry was already set to a different value or success otherwise
> >>> (also in the case it was already set to the same value). This would
> >>
> >> ... I prefer not to check the previous value. Subsequent
> numa_set_distance
> >> call will override previous calls. Keep numa_set_distance as simple as
> >> it can. And when you pass new data to numa_set_distance, it doesn't
> >> know whether the previous data was correct or the new data is correct.
> >> Only caller may have known.
> >
> > That might be OK but if not numa_set_distance then somebody else needs
> > to check against overwriting previous values. That is to be able to spot
> > bad device tree cases like:
> >
> >   0 1 20
> >   1 0 40
> 
> What's wrong with this? At least the ACPI spec cares to specifically
> permit this case:
> 

This is because some notes description in device tree NUMA binding:
- distance-matrix
  This property defines a matrix to describe the relative distances
  between all numa nodes.
  It is represented as a list of node pairs and their relative distance.

  Note:
        1. Each entry represents distance from first node to second node.
        The distances are equal in either direction.
https://www.kernel.org/doc/Documentation/devicetree/bindings/numa.txt

So we treat this case is wrong in DT. But as you said ACPI allow such
case, that means real machines allow different distances for one pair
nodes in different directions.

> "Except for the relative distance from a System Locality to itself,
>  each relative distance is stored twice in the matrix. This provides
>  the capability to describe the scenario where the relative distances
>  for the two directions between System Localities is different."
> 
> Jan


 


Rackspace

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