Re: [PATCH v4 1/3] cxl/core/region: move pmem region driver logic into region_pmem.c

From: Gregory Price

Date: Mon Mar 23 2026 - 01:37:58 EST


On Sun, Mar 22, 2026 at 07:37:28PM -0700, Alison Schofield wrote:
> On Sun, Mar 22, 2026 at 09:16:36AM -0400, Gregory Price wrote:
> > core/region.c is overloaded with per-region control logic (pmem, dax,
> > sysram, etc). Move the pmem region driver logic from region.c into
> > region_pmem.c make it clear that this code only applies to pmem regions.
> >
> > No functional changes.
>
> This always adds region_pmem.o regardless of CONFIG_CXL_PMEM.
> Are you heading towards conditionally compiling, where region_pmem.o is
> omitted if !CONFIG_CXL_PMEM?
>
> Similar question for region_dax.o
>

I hadn't considered going that far, but it doesn't seem unreasonable?

It just seemed natural to break out the code this way, but I don't know
if adding more Kconfig cruft is worth it just to save some .o's and a
smaller amount of code.

The recent pmem/nvdimm Kconfig change does kind of show that we might
have some bloat for some deployments which might not care about pmem -
for example.

~Gregory