Re: [PATCH v4 1/3] cxl/core/region: move pmem region driver logic into region_pmem.c
From: Alison Schofield
Date: Mon Mar 23 2026 - 23:51:48 EST
On Mon, Mar 23, 2026 at 01:37:49AM -0400, Gregory Price wrote:
> 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.
I guess my original thought was, what is your long term intent with
the move? And I was thinking you are probably heading to conditionally
compiling. HOWEVER, now the scaredy-cat-me is thinking, shoot, that
would add test config complexity and test misses. ie. Folks make a
change in region_dax.c, don't test with CONFIG_CXL_PMEM enabled, and
boom.
So, I lean towards keeping them all (working) together, like you have.
-- Alison
>
> ~Gregory