Re: [RFC PATCH] mm/khugepaged: cap pageblock contribution to min_free_kbytes

From: Lorenzo Stoakes (ARM)

Date: Mon Jul 27 2026 - 07:01:36 EST


On Mon, Jul 20, 2026 at 10:28:21AM +0300, Nimrod Oren wrote:
> On 17/07/2026 17:58, Zi Yan wrote:
> > On 17 Jul 2026, at 9:36, Lorenzo Stoakes (ARM) wrote:
> >> Maybe a simpler version would be to just attack the issue we actually have
> >> with it - it uses too much damn memory :)
> >>
> >> So maybe something like the attached? (you'd probably want to make this a
> >> sysctl or at least a defined value of course)
> >
> > The approach below makes sense to me. In terms of the actual cap size,
> > I asked Codex to check what possible pageblock_size and their reserved
> > sizes:
> >
> > 1. 1MB pageblock size (s390) and 11MB per zone,
> > 2. 2MB pageblock size and 22MB per zone,
> > 3. 8MB pageblock size and 88MB per zone,
> > 4. 16MB pageblock size and 176MB per zone,
> > 5. 32MB pageblock size and 352MB per zone,
> > 6. 128MB pageblock size and 1.375GB per zone,
> > 7. 512MB pageblock size and 5.5GB per zone.
> >
> > 1GB makes sense to me. 512MB might also work.
> >
>
> Assuming three eligible zones, my original proposal would have been
> equivalent to a much lower cap of 66MB:
>
> 2MB * 11 pageblocks per zone * 3 zones = 66MB
>
> Using a more conservative value also sounds reasonable to me.
>
> >> General idea is - if we're going to cap, let's just cap instead of
> >> pretending that page blocks are of a different size.
> >>
> >
> > Sounds good to me. Thank you for the suggestion.
> >
> Thanks Lorenzo and Zi for the review.
> Capping the final recommendation directly sounds good to me.

OK, feel free to respin with that! A Suggested-by is fine for me.

>
>

Cheers, Lorenzo