Re: [PATCH] mm/huge_memory: Fix outdated comment about freeing subpages in __folio_split
From: Barry Song
Date: Tue Apr 28 2026 - 06:10:08 EST
On Mon, Apr 27, 2026 at 3:42 PM David Hildenbrand (Arm)
<david@xxxxxxxxxx> wrote:
>
> On 4/26/26 22:42, Barry Song wrote:
> > On Thu, Apr 23, 2026 at 8:36 PM David Hildenbrand (Arm)
> > <david@xxxxxxxxxx> wrote:
> >>
> >> On 4/23/26 05:49, Barry Song (Xiaomi) wrote:
> >>> The comment appears to be outdated. First, add_to_swap() no longer
> >>> exists after Kairui’s commit b487a2da3575 ("mm, swap: simplify folio
> >>> swap allocation"). Second, partially zapped folios are now always
> >>> split before folio_alloc_swap() to avoid extra I/O, following Ryan’s
> >>> commit 5ed890ce5147 ("mm: vmscan: avoid split during
> >>> shrink_folio_list()").
> >>
> >> Not necessarily. We have some scenarios where we have partially-mapped folios
> >> not detected as such as of today (with CONFIG_NO_PAGE_MAPCOUNT).
> >
> > Thanks, david! would it make more sense to add “when
> > CONFIG_PAGE_MAPCOUNT is enabled” at the end of the
> > sentence?
>
> Better to phrase it in a way that doesn't even require these details :)
>
> Do we even need this detail in the patch description?
What about:
The comment appears to be outdated. add_to_swap() no longer exists,
and the explanation of why we need to call put_page() after
splitting could be made more general.
Best Regards
Barry