public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: <dan.j.williams@intel.com>
To: "Huang, Kai" <kai.huang@intel.com>,
	"Williams, Dan J" <dan.j.williams@intel.com>,
	"gourry@gourry.net" <gourry@gourry.net>
Cc: "nunodasneves@linux.microsoft.com"
	<nunodasneves@linux.microsoft.com>,
	"rafael@kernel.org" <rafael@kernel.org>,
	"Schofield, Alison" <alison.schofield@intel.com>,
	"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>,
	"linux-cxl@vger.kernel.org" <linux-cxl@vger.kernel.org>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"xueshuai@linux.alibaba.com" <xueshuai@linux.alibaba.com>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"lenb@kernel.org" <lenb@kernel.org>
Subject: Re: [PATCH] ACPI: NUMA: Only parse CFMWS at boot when CXL_ACPI is on
Date: Wed, 4 Mar 2026 18:08:36 -0800	[thread overview]
Message-ID: <69a8e5a4d2372_2f4a10056@dwillia2-mobl4.notmuch> (raw)
In-Reply-To: <bf78a2ee58e99e1fab9df3b5406f20edf9420415.camel@intel.com>

Huang, Kai wrote:
[..]
> > I think it makes sense that if you disable CXL hotplug by setting
> > CONFIG_CXL_ACPI=n then no need to reserve numa ids. However, just do
> > something like this rather than add ifdefs to the code:
> > 
> > diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c
> > index aa87ee1583a4..62d4a8df0b8c 100644
> > --- a/drivers/acpi/numa/srat.c
> > +++ b/drivers/acpi/numa/srat.c
> > @@ -654,8 +654,11 @@ int __init acpi_numa_init(void)
> >  	}
> >  	last_real_pxm = fake_pxm;
> >  	fake_pxm++;
> > -	acpi_table_parse_cedt(ACPI_CEDT_TYPE_CFMWS, acpi_parse_cfmws,
> > -			      &fake_pxm);
> > +
> > +	/* No need to expand numa nodes if CXL is disabled */
> > +	if (IS_ENABLED(CONFIG_CXL_ACPI))
> > +		acpi_table_parse_cedt(ACPI_CEDT_TYPE_CFMWS, acpi_parse_cfmws,
> > +				      &fake_pxm);
> >  
> >  	if (cnt < 0)
> >  		return cnt;
> > 
> > The call to acpi_table_parse_cedt() will get skipped and the code for
> > acpi_parse_cfmws() will get automatically compiled out of the file.
> 
> Yeah agreed this is simpler.  Thanks for the suggestion.
> 
> I would like to honor Gregory's suggestion about the comment since it
> provides more info if you agree?
> 
> (I also added "impacts certain NUMA userspace ABIs")
> 
> /*
>  * Some platforms report CEDT CFMWS for hotplug device support. These
>  * windows are unusable without CXL drivers, so don't reserve fake nodes
>  * if they're compiled out - it wastes memory on per-node structures and
>  * impacts certain NUMA userspace ABIs.
>  */

I feel like this is just too much scary detail for a tiny corner case
that maybe only effects a handful of kernel developers at hardware
companies with advanced server platforms.

    /* No need to expand numa nodes if CXL is disabled */

...is more than sufficient.

> > At the same time I doubt this patch provides end users much value in
> > practice as most distro kernels have CONFIG_CXL_ACPI, and the few end
> > users that have CXL are not going blink at the overhead to support the
> > full feature set.
> > 
> > Can you not just disable CXL support in the BIOS for your system and
> > avoid complicating this code path for a small win?
> 
> Sure I can (I need to figure out how, though).  But I think it's still
> useful for developers because some of them will tend to only enable Kconfig
> options that they need to save build time.
> 
> And sometimes it's not quite easy to turn off CXL in the BIOS since the
> machine would be mostly remote.
> 
> So I think this patch is still worthy to do?

A small 2 line patch to save a few megabytes of memory, sure. A
paragraph of context that almost nobody will ever care about on a go
forward basis? No, thank you.

  reply	other threads:[~2026-03-05  2:08 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 [this message]
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
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=69a8e5a4d2372_2f4a10056@dwillia2-mobl4.notmuch \
    --to=dan.j.williams@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=alison.schofield@intel.com \
    --cc=gourry@gourry.net \
    --cc=kai.huang@intel.com \
    --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