Re: [PATCH v2 2/2] mm: Extract non-swap page handling to do_non_swap_page()
From: Hongfu Li
Date: Mon Jul 27 2026 - 08:14:07 EST
> > mm/memory.c | 120 ++++++++++++++++++++++++++++++----------------------
> > 1 file changed, 69 insertions(+), 51 deletions(-)
> >
> > diff --git a/mm/memory.c b/mm/memory.c
> > index ae521baa8c84..50d8e92aef91 100644
> > --- a/mm/memory.c
> > +++ b/mm/memory.c
> > @@ -4815,6 +4815,74 @@ static void check_swap_exclusive(struct folio *folio, swp_entry_t entry,
> > } while (--nr_pages);
> > }
> >
> > +static vm_fault_t do_non_swap_page(struct vm_fault *vmf)
>
> We're handling softleaf entries that are not swap entries.
>
> do_nonswap_softleaf() or sth like that would be better than talking about "page"
> if there is not even a page.
>
> But actually it should be the other way around:
>
> do_softleaf_entry() [currently do_swap_page]
> ... non-swap entries
> do_swap_entry()
>
> Or sth like that. Then, maybe in the future, we can just move do_swap_entry()
> out of memory.c
>
> So we're factoring the wrong thing out in this patch.
Thank you very much for the detailed review, your analysis makes perfect sense to me.
I'm glad to send out v3 shortly for your further review, with
do_non_swap_page renamed to do_nonswap_softleaf.
Best regards,
Hongfu