[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCH v3 03/17] xen/arm: implement node distance helpers for Arm
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Henry Wang <Henry.Wang@xxxxxxx>
- Date: Mon, 24 Apr 2023 07:50:25 +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=6koWl1EEaDK1bKXULodqi9HRV5gxBShr8+3W08htdeY=; b=WNEZczuXFkBXPTSFw5bVS2TDf5yYVvpZiPUG8E93soc3M6lq70YFdZZOfNVLgYxX+UzYz5zD2QjHd6QEBpq0It+xcKkfd8PCKmCbyKvKtekoDBFV6HYOR+lPpkDsFWRrWxa1ARRSWOyZTLnAtV7oDsSc8DTUSOnL3T3oJbzNOh54DnGnNxmSWLlqT85vl/TWPl+Ms0KQLQMK0kl6Im2hYmjhAnhcEmweYhXZsWf+6okpZdodEeGsZJf/mBHemYRqLrFxW9z3HM+qnbQWG0+IjqK1d7MviC0XM5Gkkhj9TN6gFiEPrXzcddjIqGMTSton7trMdwx5Z0tlhZDPbQHhkA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WDfqucf7bhvNbRAndA80AnSCrVuFWSezA0bXxfLPvw3JugnuJ8CzkCJ9z6Mn2BdTQkhwLuBc7RyIBvNxEmtO/qCLr+ZBw/FY01AYHLniaKaOY7AP9GLSs1A57Z/Ji+xV5x4yYqnSuGtTE9ZjhSs/+XFBZ39QU7zdfwW1x+kv3i/kQn38yrkDxI0hQgghdMqToN2+nTHdpVe6CeEOLZM4q9pygXyuyblEJirBq1hslzX1Mjn3QefXUVHiiHt4J+hLNIVMUy/gP7j9gF3LOo/aYVTYRsSd28L4Yu2b6RlTykcxaMte7egP0TWoTqLiJLvaae4S7YATXbLZkiqA2eonlQ==
- 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: Mon, 24 Apr 2023 07:51:02 +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: AQHZc3rmCrt50C+BaEmmIgaK9uo9ea80IxGAgAFPzpCAABDqgIAC3lpQgAG3XoCAAACYQA==
- Thread-topic: [PATCH v3 03/17] xen/arm: implement node distance helpers for Arm
Hi Jan,
> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Subject: Re: [PATCH v3 03/17] xen/arm: implement node distance helpers for
> Arm
>
> > Thanks for the explanation! I think I now understand :) Would this diff
> below
> > look good to you then? Appreciate your patience.
>
> Looks largely okay, but possibly one part can now be omitted (see below).
>
> > unsigned char __node_distance(nodeid_t from, nodeid_t to)
> > {
> > - /* When NUMA is off, any distance will be treated as remote. */
> > + if ( from == to )
> > + return NUMA_LOCAL_DISTANCE;
> > +
> > + /* When NUMA is off, any distance will be treated as unreachable
> > (0xFF).
> */
>
> Please avoid mentioning the actual value of 0xFF: This serves no real
> purpose (afaict) and is liable to go stale at some point.
Good point, I will drop the 0xFF.
>
> > if ( numa_disabled() )
> > - return NUMA_REMOTE_DISTANCE;
> > + return NUMA_NO_DISTANCE;
>
> With the code below this is now only an optimization. Might be worth
> saying so in the comment (assuming having this optimization is deemed
> worth it).
Sounds good, if you think below comment makes sense to you, I will add:
"When NUMA is disabled, the node distance should always be
NUMA_NO_DISTANCE, directly return here as an optimization."
Kind regards,
Henry
>
> Jan
|