Linux CXL
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang@intel.com>
To: Guixin Liu <kanie@linux.alibaba.com>,
	Davidlohr Bueso <dave@stgolabs.net>,
	Jonathan Cameron <jic23@kernel.org>,
	Alison Schofield <alison.schofield@intel.com>,
	Vishal Verma <vishal.l.verma@intel.com>,
	Dan Williams <djbw@kernel.org>, Ira Weiny <iweiny@kernel.org>,
	Li Ming <ming.li@zohomail.com>
Cc: linux-cxl@vger.kernel.org
Subject: Re: [PATCH v2] cxl/region: Create node access attributes for CFMWS-only NUMA nodes
Date: Fri, 18 Sep 2026 08:39:47 -0700	[thread overview]
Message-ID: <85642d5d-b6c5-47ea-a51c-989d5bbb72b8@intel.com> (raw)
In-Reply-To: <20260917024632.1397380-1-kanie@linux.alibaba.com>



On 9/16/26 7:46 PM, Guixin Liu wrote:
> A NUMA node that only backs a CXL fixed memory window and is not
> enumerated by SRAT has no memory_target in the HMAT code, so
> hmat_callback() exits early at find_mem_target() and never creates
> the node's accessN attributes:
> /sys/devices/system/node/nodeX/accessN/initiators/* stays missing.
> 
> Commit debdce20c4f2 ("cxl/region: Deal with numa nodes not enumerated
> by SRAT") had the CXL region notifier call node_set_perf_attrs()
> directly for such nodes, but commit 2e454fb8056d ("cxl, acpi/hmat:
> Update CXL access coordinates directly instead of through HMAT")
> replaced it with node_update_perf_attrs(), which only updates
> attributes that already exist and thus does nothing for these nodes.
> 
> Create the attributes with node_set_perf_attrs() when the node is not
> backed by a real SRAT pxm.
> 
> Tested on a QEMU CXL topology with a CFMWS window not described by
> SRAT or HMAT: node1/access0/initiators/{read,write}_{bandwidth,latency}
> appear with the calculated coordinates once the region's first memory
> block comes online.
> 
> Fixes: 2e454fb8056d ("cxl, acpi/hmat: Update CXL access coordinates directly instead of through HMAT")
> Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
> Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>

Applied to cxl/next:
ef71014055f7

> ---
> Changes since v1 (https://lore.kernel.org/r/20260916120338.369436-1-kanie@linux.alibaba.com):
> 
> - Open code the one-use helper (Dave Jiang)
> - Comment why creating the attributes here is safe: this path runs
>   at most once per node (Jonathan Cameron)
> - Lead with the user visible regression (Alison Schofield)
> ---
>  drivers/cxl/core/region.c | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
> index 27e63e6dab7c..9a5fd3da539d 100644
> --- a/drivers/cxl/core/region.c
> +++ b/drivers/cxl/core/region.c
> @@ -1,5 +1,6 @@
>  // SPDX-License-Identifier: GPL-2.0-only
>  /* Copyright(c) 2022 Intel Corporation. All rights reserved. */
> +#include <linux/acpi.h>
>  #include <linux/memregion.h>
>  #include <linux/genalloc.h>
>  #include <linux/debugfs.h>
> @@ -2630,7 +2631,19 @@ static bool cxl_region_update_coordinates(struct cxl_region *cxlr, int nid)
>  
>  	for (int i = 0; i < ACCESS_COORDINATE_MAX; i++) {
>  		if (cxlr->coord[i].read_bandwidth) {
> -			node_update_perf_attrs(nid, &cxlr->coord[i], i);
> +			/*
> +			 * A CFMWS-only node (not backed by a real SRAT pxm)
> +			 * has no HMAT memory_target, so hmat_callback()
> +			 * never created the access attributes for it:
> +			 * create them here instead of only updating them.
> +			 * This is called at most once per node (see
> +			 * nodemask_region_seen), so the attributes are not
> +			 * created twice.
> +			 */
> +			if (!acpi_node_backed_by_real_pxm(nid))
> +				node_set_perf_attrs(nid, &cxlr->coord[i], i);
> +			else
> +				node_update_perf_attrs(nid, &cxlr->coord[i], i);
>  			cset++;
>  		}
>  	}


      parent reply	other threads:[~2026-09-18 15:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-17  2:46 [PATCH v2] cxl/region: Create node access attributes for CFMWS-only NUMA nodes Guixin Liu
2026-09-17  3:00 ` sashiko-bot
2026-09-17 21:06   ` Jonathan Cameron
2026-09-17  3:05 ` Gregory Price
2026-09-17 22:44 ` Alison Schofield
2026-09-18 15:39 ` Dave Jiang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=85642d5d-b6c5-47ea-a51c-989d5bbb72b8@intel.com \
    --to=dave.jiang@intel.com \
    --cc=alison.schofield@intel.com \
    --cc=dave@stgolabs.net \
    --cc=djbw@kernel.org \
    --cc=iweiny@kernel.org \
    --cc=jic23@kernel.org \
    --cc=kanie@linux.alibaba.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=ming.li@zohomail.com \
    --cc=vishal.l.verma@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox