On Mon, Nov 10, 2025 at 07:48:33PM +0000, Lorenzo Stoakes wrote:
> On Tue, Nov 11, 2025 at 01:10:03AM +0530, Garg, Shivank wrote:
> > I bisected the crash on mm-unstable
> >
> > b14d61d8fe442b1cc2d7591cf040a6dcd7fe2dd8 is the first bad commit
> > commit b14d61d8fe442b1cc2d7591cf040a6dcd7fe2dd8
> > Author: Lorenzo Stoakes <[email protected]>
> > Date: Sat Nov 8 17:08:18 2025 +0000
> >
> > mm: eliminate is_swap_pte() when softleaf_from_pte() suffices
> >
> > In cases where we can simply utilise the fact that softleaf_from_pte()
> > treats present entries as if they were none entries and thus eliminate
> > spurious uses of is_swap_pte(), do so.
> >
> > No functional change intended.
>
> Ah fun :)
>
> Thanks, this is very likely a bug that I am about to fix in the series that
> was reported on review.
>
> Could you try the attached fix-patch please?
>
> Note that this might not apply against mm-unstable, in which case replace
> 'softleaf' with 'leafent' :) as there was a rename in v2.
>
> Cheers, Lorenzo
>
> ----8<----
> From ab4d93d299f0a0ca3f1fa5e75b2ac646695b632e Mon Sep 17 00:00:00 2001
> From: Lorenzo Stoakes <[email protected]>
> Date: Mon, 10 Nov 2025 19:46:55 +0000
> Subject: [PATCH] fixup
>
> Signed-off-by: Lorenzo Stoakes <[email protected]>
> ---
> include/linux/leafops.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/leafops.h b/include/linux/leafops.h
> index a464a7e08c76..325cc87c3363 100644
> --- a/include/linux/leafops.h
> +++ b/include/linux/leafops.h
> @@ -56,7 +56,7 @@ static inline softleaf_t softleaf_from_pte(pte_t pte)
> {
> softleaf_t arch_entry;
>
> - if (pte_present(pte))
> + if (pte_present(pte) || pte_none())
Sorry that should be pte_none(pte)... obviously!
It's late here :)
> return softleaf_mk_none();
>
> pte = pte_swp_clear_flags(pte);
> @@ -95,7 +95,7 @@ static inline softleaf_t softleaf_from_pmd(pmd_t pmd)
> {
> softleaf_t arch_entry;
>
> - if (pmd_present(pmd))
> + if (pmd_present(pmd) || pmd_none(pmd))
> return softleaf_mk_none();
>
> if (pmd_swp_soft_dirty(pmd))
> --
> 2.51.0
>
> Thanks, Lorenzo