From: Juan Yescas <jyescas@google.com>
To: "David Hildenbrand (Arm)" <david@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>,
Kalesh Singh <kaleshsingh@google.com>,
"T.J. Mercier" <tjmercier@google.com>,
Isaac Manjarres <isaacmanjarres@google.com>,
android-mm <android-mm@google.com>,
Linux Memory Management List <linux-mm@kvack.org>,
Matthew Wilcox <willy@infradead.org>,
Vlastimil Babka <vbabka@suse.cz>,
Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
lsf-pc@lists.linux-foundation.org
Subject: Re: [LSF/MM/BPF TOPIC] Discussion: Targeted memory allocation via debugfs
Date: Thu, 9 Apr 2026 08:57:40 -0700 [thread overview]
Message-ID: <CAJDx_rjgyi-L-1j2kpi1NeKj+Huynd6ZFqJDmYqN8i8L3KyBfw@mail.gmail.com> (raw)
In-Reply-To: <aa8e148f-252f-4d81-89db-b1702d9b6888@kernel.org>
On Thu, Apr 9, 2026 at 1:06 AM David Hildenbrand (Arm) <david@kernel.org> wrote:
>
> >>
> >> echo 1 >
> >> /sys/kernel/debug/mm/node-1/zone-movable/order-10/migrate-Movable/alloc
> >>
> >> You are just breaking ZONE_MOVABLE guarantees. Or what am I missing?
> >
> > I see. How should the ZONE_MOVABLE allocations be handled? Should they
> > be excluded?
>
> Well, the same applies to MIGRATE_CMA: if you end up placing unmovable
> allocations in these areas, you will break these scenarios.
>
I see what you mean. I was not understanding your point. In that case,
the driver will have to remove the unmovable or
Invalid migrate types directories from the sysfs interface. Only valid
migrate types, orders will be allowed.
The same applies to ZONE_MOVABLE. Only valid migrate types must be
included in the sysfs directories.
> Your driver would have to support page migration, but that's not
> trivial. For example, movable_ops pages currently only support order-0
> pages.
>
I agree with you. If we only allow valid migrate types, we don't have
to support page migration :)
> >
> >>
> >>>
> >>>
> >>> We could use a "nr_pages" variable, but we would also need to set the
> >>> node, zone and migrate type.
> >>>
> >>> It would be cumbersome and error prone to have something like this:
> >>>
> >>> echo "Node1/zone-Normal/MIGRATE_RECLAIMABLE/8" > /proc/kernel/debug/mm/nr_pages
> >>
> >> I meant something like:
> >>
> >> echo 1 >
> >> /sys/kernel/debug/mm/node-1/zone-Normal/order-10/migrate-Umovable/nr_pages
> >
> > Got it, we can do something like that. It makes more sense.
> >
> >>
> >> (not sure if we really want to specify the migratetype)
> >>
> >
> > The migrate type is important because we want to make both MIGRATE_CMA
> > and MIGRATE_RECLAIMABLE allocations.
>
> See above regarding MIGRATE_CMA.
>
> But in general, bypassing the page allocator and just allocating random
> pages is not really nice, not even for a debug feature.
>
I agree. My intent is not to bypass the page allocator. We will use
the page allocator and
This will allow only valid cases (I will remove invalid migrate types
from the sysfs directories for CMA and ZONE_MOVABLE).
> In particular for the scenarios you mentioned:
>
> - CMA allocation failures due to pinned MIGRATE_MOVABLE pages.
>
> I think some decent user-space reproducers might be a lot more elegant.
>
> I guess for CMA, you'd want a way to allocate some ordinary *user space*
> (anonymous) memory and be able to check whether the memory was allocated
> on CMA memory, to then fire up a page pinning storm and concurrently
> trying to allocate the memory.
>
> So maybe you really want a debug mechanism to migrate a (movable) user
> space page into a CMA area?
>
One intent of this driver is to debug CMA issues (pinned MOVABLE pages). This
The driver will allow easy reproduction of the case you just
mentioned. For example,
I will allocate most of the MOVABLE pages and then trigger a CMA
allocation, that might trigger a migration.
However, the driver's main goal is to put the system into low-memory conditions.
so we can reproduce OOO, kswad, lmkd issues seeing in the devices.
Thanks
Juan
> --
> Cheers,
>
> David
prev parent reply other threads:[~2026-04-09 15:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-27 2:42 Juan Yescas
2026-03-16 15:52 ` David Hildenbrand (Arm)
2026-03-19 0:56 ` Juan Yescas
2026-03-23 9:14 ` David Hildenbrand (Arm)
2026-04-08 0:12 ` Juan Yescas
2026-04-08 7:47 ` David Hildenbrand (Arm)
2026-04-08 21:32 ` Juan Yescas
2026-04-09 8:06 ` David Hildenbrand (Arm)
2026-04-09 15:57 ` Juan Yescas [this message]
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=CAJDx_rjgyi-L-1j2kpi1NeKj+Huynd6ZFqJDmYqN8i8L3KyBfw@mail.gmail.com \
--to=jyescas@google.com \
--cc=android-mm@google.com \
--cc=david@kernel.org \
--cc=isaacmanjarres@google.com \
--cc=kaleshsingh@google.com \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=lsf-pc@lists.linux-foundation.org \
--cc=surenb@google.com \
--cc=tjmercier@google.com \
--cc=vbabka@suse.cz \
--cc=willy@infradead.org \
/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