Re: [PATCH v2 2/2] mm: Extract non-swap page handling to do_non_swap_page()
From: Christoph Hellwig
Date: Mon Jul 27 2026 - 23:19:28 EST
On Fri, Jul 24, 2026 at 09:33:12PM +0200, David Hildenbrand (Arm) wrote:
> 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.
Yes. From the code structure it also is really obvious that the
block handling the softleaf_is_device_private() should be a separate
helper instead of a giant code block sitting in the middle of an
if/else chain where every other case has a well-defined helper.