Re: [PATCH] Revert "mm, hugetlb: remove hugepages_treat_as_movable sysctl"

Michal Hocko
2025-10-09T18:47:44Z

On Thu 09-10-25 11:29:57, Gregory Price wrote:
> On Thu, Oct 09, 2025 at 08:14:22AM +0200, Michal Hocko wrote:
> > On Wed 08-10-25 12:31:22, Gregory Price wrote:
> > > > I'm not quite clear yet on the use case, though. If all the user allocations
> > > > end up fragmenting the memory, there is also not a lot of benefit to be had
> > > > from that zone long term.
> > > >
> > >
> > > The only real use case i've seen is exactly:
> > > - Don't want random GFP_KERNEL to land there
> > > - Might want it to be pinnable
> > >
> > > I think that covers what you've described above.
> > >
> > > But adding an entire zone felt a bit heavy handed. Allowing gigantic in
> > > movable seemed less - immediately - offensive.
> >
> > The question is whether we need a full zone for that or we can control
> > those allocation constrains on per memory block bases to override
> > otherwise default. So it wouldn't be MOVABLE but rather something like
> > USER zone.
>
>
> Mild ignorance here - but I don't think the buddy allocator currently
> differentiates chunks of memory based on block membership, it just eats
> folios from certain zones/nodes.

No ignorance on your end. As I've said this is not fully thought through
idea. Memory block was meant to be userspace configurable unit.
Internally this would need to be mapped into migrate type or something
like that.
--
Michal Hocko
SUSE Labs