From: Gregory Price <gourry@gourry.net>
To: Brendan Jackman <jackmanb@google.com>
Cc: linux-mm@kvack.org, kernel-team@meta.com,
vishal.l.verma@intel.com, ira.weiny@intel.com,
dan.j.williams@intel.com, longman@redhat.com,
akpm@linux-foundation.org, david@kernel.org,
lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com,
vbabka@suse.cz, rppt@kernel.org, surenb@google.com,
mhocko@suse.com, osalvador@suse.de, ziy@nvidia.com,
matthew.brost@intel.com, joshua.hahnjy@gmail.com,
rakie.kim@sk.com, byungchul@sk.com, ying.huang@linux.alibaba.com,
apopple@nvidia.com, axelrasmussen@google.com, yuanchu@google.com,
weixugc@google.com, yury.norov@gmail.com,
linux@rasmusvillemoes.dk, mhiramat@kernel.org,
mathieu.desnoyers@efficios.com, tj@kernel.org,
hannes@cmpxchg.org, mkoutny@suse.com, sj@kernel.org,
baolin.wang@linux.alibaba.com, npache@redhat.com,
ryan.roberts@arm.com, dev.jain@arm.com, baohua@kernel.org,
lance.yang@linux.dev, muchun.song@linux.dev, xu.xin16@zte.com.cn,
chengming.zhou@linux.dev, jannh@google.com, linmiaohe@huawei.com,
nao.horiguchi@gmail.com, pfalcato@suse.de, rientjes@google.com,
shakeel.butt@linux.dev, riel@surriel.com, harry.yoo@oracle.com,
cl@gentwo.org, roman.gushchin@linux.dev, chrisl@kernel.org,
kasong@tencent.com, shikemeng@huaweicloud.com, nphamcs@gmail.com,
bhe@redhat.com, zhengqi.arch@bytedance.com, terry.bowman@amd.com,
owner-linux-mm@kvack.org
Subject: Re: [RFC] __GFP_UNMAPPED and __GFP_PRIVATE follow up
Date: Sun, 17 May 2026 10:05:57 -0400 [thread overview]
Message-ID: <agnLRSpecgsQzNOn@gourry-fedora-PF4VCD3F> (raw)
In-Reply-To: <DIJF01KNX2V6.23MF18D4X99EX@google.com>
On Fri, May 15, 2026 at 05:09:21PM +0000, Brendan Jackman wrote:
> On Fri May 15, 2026 at 3:48 PM UTC, Gregory Price wrote:
> > On Fri, May 15, 2026 at 09:43:02AM +0000, Brendan Jackman wrote:
> >
> > I'll have to think about the NODE_DATA replacement. I don't know if
> > that's really feasible consider that this structure is used statically
> > all over the kernel for runtime node-data lookups from pages/folios.
>
> Oh yeah I wasn't thinking of replacing it completely, more that the
> global NODE_DATA is the "default" node data (and the pointer field being
> NULL would probably mean to use that), but then private node datas could
> also exist.
>
More accurately - any node in node_state[N_MEMORY].
Any node not in node_state[N_MEMORY] and is essentially invisible to
page_alloc.c by nature of not being in any fallback lists.
In my series I don't add the private node to N_MEMORY, instead add
N_MEMORY_PRIVATE and never add them to the fallback list of normal
nodes, that makes them functionally invisible unless you call
alloc_pages_node() with that node id.
If you stop there, then alloc_pages_node(private_nid, ...) works
exactly the same as it did before (which is actually an issue in my
case, as you still have to contend with other nodemasks containing the
node id still).
So if you wanted to go off testing the page allocator, you could do it
with a private node. Since otherwise the node gets exempted from the
rest of mm/, you'd just need to make sure to use __GFP_THISNODE so your
allocations fail w/o calling oom infrastructure and handle those
conditions accoridingly.
>
> I spent a few days trying to solve this in the way that VMA and xarray
> etc have, i.e. by making the page allocator a library and then testing
> it from userspace. I think that would work but it needs much more than a
> few days to make it happen (admittedly, I had tried to do this with AI
> at the time and it failed miserably. Maybe with today's models it would
> work, which could massively accelerate the grunt work of e.g. splitting
> stuff into new files).
>
I doubt you could get enough parity in userspace to make this a useful
exercise. All the per-cpu interactions turn into per-thread
interactions, and you'd end up deleting most of what makes page_alloc.c
useful (all the external interactions - reclaim, compaction, oom, etc).
Plus there's cgroup/cpuset and accounting interactions that are
non-trivial.
The more I think about this, the less I think it's a tractable problem
ending in a mergable series.
> But anyway, if you could carve out a distinct node data etc you could just
> write KUnit tests that operate on a completely isolated "instance" of
> the allocator, even though it still runs in a real kernel.
I'm fairly certain private nodes basically already do this - with the
exception of certain global counters (vm stats), and certain global
settings (like you describe above).
~Gregory
next prev parent reply other threads:[~2026-05-17 14:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-14 17:42 [RFC] __GFP_UNMAPPED and __GFP_PRIVATE follow up Gregory Price
2026-05-15 9:43 ` Brendan Jackman
2026-05-15 15:48 ` Gregory Price
2026-05-15 17:09 ` Brendan Jackman
2026-05-17 14:05 ` Gregory Price [this message]
2026-05-18 9:59 ` David Hildenbrand (Arm)
2026-05-18 7:12 ` Harry Yoo (Oracle)
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=agnLRSpecgsQzNOn@gourry-fedora-PF4VCD3F \
--to=gourry@gourry.net \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=axelrasmussen@google.com \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=bhe@redhat.com \
--cc=byungchul@sk.com \
--cc=chengming.zhou@linux.dev \
--cc=chrisl@kernel.org \
--cc=cl@gentwo.org \
--cc=dan.j.williams@intel.com \
--cc=david@kernel.org \
--cc=dev.jain@arm.com \
--cc=hannes@cmpxchg.org \
--cc=harry.yoo@oracle.com \
--cc=ira.weiny@intel.com \
--cc=jackmanb@google.com \
--cc=jannh@google.com \
--cc=joshua.hahnjy@gmail.com \
--cc=kasong@tencent.com \
--cc=kernel-team@meta.com \
--cc=lance.yang@linux.dev \
--cc=linmiaohe@huawei.com \
--cc=linux-mm@kvack.org \
--cc=linux@rasmusvillemoes.dk \
--cc=longman@redhat.com \
--cc=lorenzo.stoakes@oracle.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=matthew.brost@intel.com \
--cc=mhiramat@kernel.org \
--cc=mhocko@suse.com \
--cc=mkoutny@suse.com \
--cc=muchun.song@linux.dev \
--cc=nao.horiguchi@gmail.com \
--cc=npache@redhat.com \
--cc=nphamcs@gmail.com \
--cc=osalvador@suse.de \
--cc=owner-linux-mm@kvack.org \
--cc=pfalcato@suse.de \
--cc=rakie.kim@sk.com \
--cc=riel@surriel.com \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
--cc=rppt@kernel.org \
--cc=ryan.roberts@arm.com \
--cc=shakeel.butt@linux.dev \
--cc=shikemeng@huaweicloud.com \
--cc=sj@kernel.org \
--cc=surenb@google.com \
--cc=terry.bowman@amd.com \
--cc=tj@kernel.org \
--cc=vbabka@suse.cz \
--cc=vishal.l.verma@intel.com \
--cc=weixugc@google.com \
--cc=xu.xin16@zte.com.cn \
--cc=ying.huang@linux.alibaba.com \
--cc=yuanchu@google.com \
--cc=yury.norov@gmail.com \
--cc=zhengqi.arch@bytedance.com \
--cc=ziy@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.