[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <789664CF-2350-4E31-ADA3-BD08FAFC496B@nvidia.com>
Date: Tue, 02 Sep 2025 13:04:58 -0400
From: Zi Yan <ziy@...dia.com>
To: David Hildenbrand <david@...hat.com>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
linux-kselftest@...r.kernel.org
Subject: Re: [PATCH v2 1/2] selftests/mm: split_huge_page_test: fix occasional
is_backed_by_folio() wrong results
On 2 Sep 2025, at 12:25, David Hildenbrand wrote:
> When checking for actual tail or head pages of a folio, we must make
> sure that the KPF_COMPOUND_HEAD/KPF_COMPOUND_TAIL flag is paired with
> KPF_THP.
>
> For example, if we have another large folio after our large folio in
> physical memory, our "pfn_flags & (KPF_THP | KPF_COMPOUND_TAIL" would
> trigger even though it's actually a head page of the next folio.
>
> If is_backed_by_folio() returns a wrong result, split_pte_mapped_thp()
> can fail with "Some THPs are missing during mremap".
>
> Fix it by checking for head/tail pages of folios properly. Add
> folio_tail_flags/folio_head_flags to improve readability and use these
> masks also when just testing for any compound page.
>
> Fixes: 169b456b0162 ("selftests/mm: reimplement is_backed_by_thp() with more precise check")
> Signed-off-by: David Hildenbrand <david@...hat.com>
> ---
> tools/testing/selftests/mm/split_huge_page_test.c | 15 +++++++--------
> 1 file changed, 7 insertions(+), 8 deletions(-)
>
LGTM. Thanks for fixing it. Reviewed-by: Zi Yan <ziy@...dia.com>
Best Regards,
Yan, Zi
Powered by blists - more mailing lists