Re: [PATCH 03/12] mm/khugepaged: rename mthp_present_ptes bitmap to eligible_ptes
From: Zi Yan
Date: Fri Sep 04 2026 - 22:28:47 EST
On Fri Sep 4, 2026 at 11:10 AM EDT, Kiryl Shutsemau wrote:
> From: "Kiryl Shutsemau (Meta)" <kas@xxxxxxxxxx>
>
> The name says less than the bit means. A set bit means not only that the
> PTE is present, but also that it passed the other checks: uffd,
> lazyfree, anonymity, sharing. The PTE can be considered a collapse
> source.
>
> mthp_collapse() then reads the bitmap starting at the PMD order, so the
> bitmap is not specific to mTHP either.
>
> Name it for what a set bit means, and update the comments that named it.
>
> No functional change.
>
> Assisted-by: Claude-Code:claude-opus-5
> Signed-off-by: Kiryl Shutsemau (Meta) <kas@xxxxxxxxxx>
> ---
> mm/khugepaged.c | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
>
<snip>
> @@ -1514,12 +1514,12 @@ static enum scan_result mthp_collapse(struct mm_struct *mm,
> goto next_order;
>
> max_ptes_none = collapse_max_ptes_none(cc, NULL, order);
> - nr_occupied_ptes = bitmap_weight_from(cc->mthp_present_ptes, offset,
> + nr_occupied_ptes = bitmap_weight_from(cc->eligible_ptes, offset,
> offset + nr_ptes);
s/nr_occupied_ptes/nr_eligible_ptes too?
Otherwise, LGTM.
Reviewed-by: Zi Yan <ziy@xxxxxxxxxx>
--
Best Regards,
Yan, Zi