Re: [PATCH 03/22] mm: introduce the common-memory node state
From: Gregory Price (Meta)
Date: Wed Nov 18 2026 - 10:51:25 EST
On 2026-11-18 23:24 +0800, Richard Cheng wrote:
> On Sat, Nov 14, 2026 at 02:09:40AM +0800, Gregory Price (Meta) wrote:
> > N_MEMORY is overloaded with two meanings:
> > 1) a node has memory.
> > 2) a node's memory is reachable via ordinary allocation or
> > an arbitrary MM service may use that memory.
> >
> > Allow N_MEMORY to mean #1, and introduce N_MEMORY_COMMON to mean #2.
> >
> > N_MEMORY_COMMON nodes contain "common memory" capable of being managed
> > arbitrarily by the kernel MM based solely on zone membership. Following
> > commits convert relevant N_MEMORY users to N_MEMORY_COMMON.
> >
> > Add folio_is_common_memory() and page_is_common_memory() for MM services
> > that walk folios. Following commits convert folio_is_zone_device() and
> > page_is_zone_device() callers accordingly.
> >
> > Expose the state via `has_common_memory` so userspace can identify
> > the memory available to ordinary allocations and common MM services.
> >
> > Add has_memory to the docs while we're here.
> >
> > Every node with memory is common, so N_MEMORY_COMMON equals N_MEMORY
> > and there is no behavioral change.
> >
>
> This sentense kind of blurred me, you state that N_MEMORY_COMMON is meant
> to isolate the concept of #2 from N_MEMORY, I expect something
> making clear distinction between common memory and private memory ?
>
Sorry, basically as of this set:
node_state[N_MEMORY] == node_state[N_MEMORY_COMMON]
Later, we'll introduce N_MEMORY_PRIVATE and the sets become disjoint.
I realize posting this series in isolation was a mistake now, and I am
going to post the entire v6 of private nodes with the reworks you
suggested instead.
--
~Gregory