Re: [PATCH v2] mm/hugetlb: Restore failed global reservations to subpool
From: Andrew Morton
Date: Mon Feb 02 2026 - 21:39:33 EST
On Wed, 21 Jan 2026 09:47:54 -0800 Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
> On Fri, 16 Jan 2026 15:40:36 -0500 Joshua Hahn <joshua.hahnjy@xxxxxxxxx> wrote:
>
> > Commit a833a693a490 ("mm: hugetlb: fix incorrect fallback for subpool")
> > fixed an underflow error for hstate->resv_huge_pages caused by
> > incorrectly attributing globally requested pages to the subpool's
> > reservation.
> >
> > Unfortunately, this fix also introduced the opposite problem, which would
> > leave spool->used_hpages elevated if the globally requested pages could
> > not be acquired. This is because while a subpool's reserve pages only
> > accounts for what is requested and allocated from the subpool, its
> > "used" counter keeps track of what is consumed in total, both from the
> > subpool and globally. Thus, we need to adjust spool->used_hpages in the
> > other direction, and make sure that globally requested pages are
> > uncharged from the subpool's used counter.
> >
> > ...
> >
> > Fixes: a833a693a490 ("mm: hugetlb: fix incorrect fallback for subpool")
> > Signed-off-by: Joshua Hahn <joshua.hahnjy@xxxxxxxxx>
> > Cc: stable@xxxxxxxxxxxxxxx
>
> This (simple, cc:stable) patch presently has no reviews, if someone
> could please be so kind.
Oh.
Joshua, it's unclear from the changelog - what are the userspace-visible
effects of the bug?