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

RE: [PATCH v4 03/17] xen/arm: implement node distance helpers for Arm


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Henry Wang <Henry.Wang@xxxxxxx>
  • Date: Tue, 25 Apr 2023 09:31:54 +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=aLDGvAkRP281Y3BToysipj4WgL+Mh3vkMqKfKo3cS+A=; b=ew4n5fY+ppSfUYxDe7/1/764Jp/Qz9lpSo8TzW6L5fB2byzxsPVf7/Teqt/j9S/Xkw2fKSZFkPYkzLj9Qn1h5sBN5fPBxphbeu+5VCS3+b2t9E7/+tC9zl7dsk7SI57tnZuND+uMwP6W8ozfdGaQgPkn2TggaEM51ytVtA/mmlcO6gvxpTwVhcOYIqEf80SWhgIRHjDgduqxZp7lp6wtC0BBSvYP/iqGWOMFQqjYBmF/mw9VkX2xWcM2/YdK0SkEo4fUzLY43ci0qltSVZ6LabSai1LHGWWMJCgzW02eZBu+uw9VfCsm24gIt2EeBIchlO/Ii4mQRYVUybjZLqXoqg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A+S/MPiYdpIFK04hhMTy4gIVFWnHn7af2zDtp0nlx9E4ypKkm7tQNr0I5MDISGWgL9Z8nv34zSFzANE3NBzMLtIorFtGlHqrjiO639+HOUnASdS4gNPiXbhVvob6De5QxCD7yDNedzwpJah/6mHoWgS+t/uDTK/IlnYRHAJlto7gHR34xH8SmQj6XxCMKBWubLfzFLeELVYH6YxLZtQfQjPWLq7xR7VvpKP179BD+HU2ZtC43nv8K3ztw0PTPcozE4FmYKNjQpL9GW7r7qlal1QlkYHVJPeRq8GSrfj4g5OutCvOI0oWe6M3ESauPwcf+M4KiU6MttBenBGn1ymqDQ==
  • 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>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, 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: Tue, 25 Apr 2023 09:32:22 +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: AQHZd0uatmvJ8yLEu0+BYdIuaJgbea87s6sAgAANHMA=
  • Thread-topic: [PATCH v4 03/17] xen/arm: implement node distance helpers for Arm

Hi Jan,

> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Subject: Re: [PATCH v4 03/17] xen/arm: implement node distance helpers for
> Arm
> 
> On 25.04.2023 09:56, Henry Wang wrote:
> > --- a/xen/arch/arm/numa.c
> > +++ b/xen/arch/arm/numa.c
> > @@ -28,6 +28,12 @@ enum dt_numa_status {
> >
> >  static enum dt_numa_status __ro_after_init device_tree_numa =
> DT_NUMA_DEFAULT;
> >
> > +static unsigned char __ro_after_init
> > +node_distance_map[MAX_NUMNODES][MAX_NUMNODES] = {
> > +    [0 ... MAX_NUMNODES - 1] = { [0 ... MAX_NUMNODES - 1] =
> NUMA_NO_DISTANCE }
> > +};
> > +
> > +
> 
> Nit: A stray 2nd blank line has appeared here.

Will fix this in v5.

> 
> > +    /* NUMA defines NUMA_NO_DISTANCE as unreachable and 0-9 are
> undefined */
> > +    if ( distance >= NUMA_NO_DISTANCE || distance <=
> NUMA_DISTANCE_UDF_MAX ||
> > +         (from == to && distance != NUMA_LOCAL_DISTANCE) )
> > +    {
> > +        printk(KERN_WARNING
> > +               "NUMA: invalid distance: from=%"PRIu8" to=%"PRIu8"
> distance=%"PRIu32"\n",
> > +               from, to, distance);
> > +        return;
> > +    }
> 
> I appreciate the checking that node-local references are
> NUMA_LOCAL_DISTANCE,
> but if they're wrongly passed into here, shouldn't the resulting array still
> have NUMA_LOCAL_DISTANCE on its diagonal, at least as far as present nodes
> go?

Apologies in advance to ask more specific details from you as I am not sure
if I can correctly understand the "if they're wrongly passed into here" case. 
Do you
mean we are always guaranteed that if from == to, the distance will always be
NUMA_LOCAL_DISTANCE so the (from == to && distance != NUMA_LOCAL_DISTANCE)
check is redundant and can be removed? Thanks.

> 
> > +    node_distance_map[from][to] = distance;
> > +}

[...]

> > +    /*
> > +     * Check whether the nodes are in the matrix range.
> > +     * When any node is out of range, except from and to nodes are the
> > +     * same, we treat them as unreachable.
> 
> I think this "except ..." part is slightly confusing, as it doesn't comment
> the subsequent code, but instead refers to the first check in the function.
> If you want to keep it, may I suggest to add something like "(see above)"
> before the comma?

Sure, I will add "(see above)" in v5.

Kind regards,
Henry

> 
> Jan

 


Rackspace

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