public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Huang, Kai" <kai.huang@intel.com>
To: "Schofield, Alison" <alison.schofield@intel.com>,
	"gourry@gourry.net" <gourry@gourry.net>
Cc: "nunodasneves@linux.microsoft.com"
	<nunodasneves@linux.microsoft.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"rafael@kernel.org" <rafael@kernel.org>,
	"thorsten.blum@linux.dev" <thorsten.blum@linux.dev>,
	"wangyuquan1236@phytium.com.cn" <wangyuquan1236@phytium.com.cn>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Williams, Dan J" <dan.j.williams@intel.com>,
	"lenb@kernel.org" <lenb@kernel.org>,
	"xueshuai@linux.alibaba.com" <xueshuai@linux.alibaba.com>,
	"linux-cxl@vger.kernel.org" <linux-cxl@vger.kernel.org>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>
Subject: Re: [PATCH] ACPI: NUMA: Only parse CFMWS at boot when CXL_ACPI is on
Date: Thu, 5 Mar 2026 00:04:57 +0000	[thread overview]
Message-ID: <acc37740d0d7fb2bdf12f181028addb1eea2e169.camel@intel.com> (raw)
In-Reply-To: <aai-K2tEdIp5B4XP@aschofie-mobl2.lan>

On Wed, 2026-03-04 at 15:20 -0800, Alison Schofield wrote:
> On Wed, Mar 04, 2026 at 05:33:26PM -0500, Gregory Price wrote:
> > On Thu, Mar 05, 2026 at 10:33:42AM +1300, Kai Huang wrote:
> > > Increasing the 'nr_node_ids' has side effects.  For instance, it is
> > > widely used by the kernel for "highest possible NUMA node" based memory
> > > allocations.  It also impacts userspace ABIs, e.g., some NUMA memory
> > > related system calls such as 'get_mempolicy' which requires 'maxnode'
> > > not being smaller than the 'nr_node_ids'.
> > > 
> 
> > 
> > Is this a Linux issue or a Firmware issue?

There are two issues actually: 

1) on my testing platform, we can see CFMWS tables but there's no actual CXL
memory inserted AFAICT; 

2) The kernel unconditionally bumps the 'nr_node_ids' even CXL_ACPI driver
is not able to detect any real CXL memory (or it is CXL port/mem driver
cannot detect, for which I am not very familiar with).

We can argue the 1) is FW issue.  But this patch aims to improve the 2),
which is an improvement regardless the firmware has issue or not:

If CXL_ACPI isn't even enabled in Kconfig, there's no need to detect CFMWS
tables and assign a 'faked NUMA node' during boot.

IIUC this is even true on a perfect fine machine with actual CXL memory
installed, since the kernel still have an option to disable CXL_ACPI in
Kconfig.

> 
> IIUC BIOS creates the CEDT based on the hardware it 'sees' as present.
> 
> This patch is describing the case (weird as it seems to me) where we
> then boot a system with ACPI and NUMA enabled but CXL_ACPI disabled.

When I found this issue the CXL_ACPI is enabled in Kconfig, but there's no
actual CXL memory being discovered AFAICT.

 #cxl list

tells me nothing.

> 
> So, I don't think we can blame BIOS.

As said above, I think it's an improvement in the kernel even on a good
machine with CXL memory inserted.

> 
> > 
> > Is GNR exporting more CFMWS than it should?
> Not sure of any limits on flavors of CFMWS's a BIOS can offer.
> If BIOS can carve out a window, it can create a CFMWS.
> Not clear how that matters to the issue.
> 
> > 
> > Is your SRAT missing entries for CFMWS that are otherwise present?
> > 
> > Are the CFMWS empty? (is that even valid)
> 
> Why this line of questioning ;)  I see the problem as a bit simpler.
> We have other code that tells us if the CFMWS's are valid, etc, but
> the point here is, we are not going to use these CFMWS's so stop
> the parse as early as possible, like right here as Kai has done.

Yes. :-)

> 
> > 
> > > E.g., on the aforementioned GNR platform, the "Slab" in /proc/meminfo is
> > > reduced with this change (when CXL_ACPI is off):
> > > 
> > > 	w/ this change		w/o
> > > 
> > > Slab	900488 kB		923660 kB
> > > 
> > 
> > This is a good effect, but I still question the premise.
> > 
> > We don't usually want #ifdef's inside of .c files if we can avoid it.
> 
> I thought similar, but for early init and static helpers, this 
> #if IS_ENABLE(..) wrapper is common.

Yes.  They are early init and static helpers, so no header file is involved
here.

I also see #if defined(CONFIG_X86) || defined(CONFIG_ARM64) is used for
acpi_parse_gi_affinity() in this file.

> 
> 
> Reviewed-by: Alison Schofield <alison.schofield@intel.com>

Thanks!

  parent reply	other threads:[~2026-03-05  0:05 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-04 21:33 [PATCH] ACPI: NUMA: Only parse CFMWS at boot when CXL_ACPI is on Kai Huang
2026-03-04 22:33 ` Gregory Price
2026-03-04 23:20   ` Alison Schofield
2026-03-04 23:56     ` Gregory Price
2026-03-05  0:14       ` Huang, Kai
2026-03-05  0:29         ` Gregory Price
2026-03-05  0:45           ` Huang, Kai
2026-03-05  1:05             ` Gregory Price
2026-03-05  1:29             ` dan.j.williams
2026-03-05  1:51               ` Huang, Kai
2026-03-05  2:08                 ` dan.j.williams
2026-03-05  2:22                   ` Gregory Price
2026-03-05  3:01                     ` dan.j.williams
2026-03-05 10:24                       ` Huang, Kai
2026-03-05  8:11         ` Haifeng Xu
2026-03-05 10:25           ` Huang, Kai
2026-03-05 11:26             ` Haifeng Xu
2026-03-05  0:04     ` Huang, Kai [this message]
2026-03-05  0:44       ` Alison Schofield
2026-03-05  1:12         ` Huang, Kai

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=acc37740d0d7fb2bdf12f181028addb1eea2e169.camel@intel.com \
    --to=kai.huang@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=alison.schofield@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=gourry@gourry.net \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nunodasneves@linux.microsoft.com \
    --cc=rafael@kernel.org \
    --cc=thorsten.blum@linux.dev \
    --cc=wangyuquan1236@phytium.com.cn \
    --cc=xueshuai@linux.alibaba.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