Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>
To: "David Hildenbrand (Arm)" <david@kernel.org>
Cc: Hongfu Li <hongfu.li@linux.dev>,
	akpm@linux-foundation.org,  liam@infradead.org,
	lihongfu@kylinos.cn, linux-kernel@vger.kernel.org,
	 linux-mm@kvack.org, mhocko@suse.com, rppt@kernel.org,
	surenb@google.com,  vbabka@kernel.org
Subject: Re: [PATCH v2 2/2] mm: Extract non-swap page handling to do_non_swap_page()
Date: Mon, 27 Jul 2026 14:58:54 +0100	[thread overview]
Message-ID: <amdi9l29BkppMIit@lucifer> (raw)
In-Reply-To: <cd6652a3-547a-47b9-8907-e98a582a238e@kernel.org>

On Mon, Jul 27, 2026 at 02:16:40PM +0200, David Hildenbrand (Arm) wrote:
> On 7/27/26 14:10, Hongfu Li wrote:
> >>>  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.
>
> Read again, that's not what I meant.

Yeah please do NOT introduce 'nonswap' we already had fun with the nonswap swap
entry before :)

Quoting David:

	do_softleaf_entry() [currently do_swap_page]
		... non-swap entries
		do_swap_entry()

Also, swap entries _are_ softleaf entries.

The whole point of the softleaf change/renaming was to differentiate page
table entries that are purely there for mapping stuff from the hardware's
point of view (non-present because nothing is mapped there, present if
mapping something) vs. something non-present because the entry is
software-defined (hence SOFT-leaf).

Swap entries are software-defined and thus fall into category.

You can see all of the softleaf types trivially in include/linux/leafops.h
in enum softleaf_type:

enum softleaf_type {
	/* Fundamental types. */
	SOFTLEAF_NONE,
	SOFTLEAF_SWAP,
	/* Migration types. */
	SOFTLEAF_MIGRATION_READ,
	SOFTLEAF_MIGRATION_READ_EXCLUSIVE,
	SOFTLEAF_MIGRATION_WRITE,
	/* Device types. */
	SOFTLEAF_DEVICE_PRIVATE_READ,
	SOFTLEAF_DEVICE_PRIVATE_WRITE,
	SOFTLEAF_DEVICE_EXCLUSIVE,
	/* H/W posion types. */
	SOFTLEAF_HWPOISON,
	/* Marker types. */
	SOFTLEAF_MARKER,
};

>
> --
> Cheers,
>
> David

Cheers, Lorenzo

P.S. I do remember suggesting that you _slow down_ :) we are into the quiet
period now so let's maybe reduce the pace of series + respins, thanks.


  reply	other threads:[~2026-07-27 13:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-23  3:07 [PATCH v2 0/2] mm: folio conversion and refactoring in do_swap_page() Hongfu Li
2026-07-23  3:07 ` [PATCH v2 1/2] mm: Use a folio in the softleaf_is_device_private path Hongfu Li
2026-07-27 16:29   ` Lorenzo Stoakes (ARM)
2026-07-23  3:07 ` [PATCH v2 2/2] mm: Extract non-swap page handling to do_non_swap_page() Hongfu Li
2026-07-24 19:33   ` David Hildenbrand (Arm)
2026-07-27 12:10     ` Hongfu Li
2026-07-27 12:16       ` David Hildenbrand (Arm)
2026-07-27 13:58         ` Lorenzo Stoakes (ARM) [this message]
2026-07-27 16:30   ` Lorenzo Stoakes (ARM)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=amdi9l29BkppMIit@lucifer \
    --to=ljs@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=david@kernel.org \
    --cc=hongfu.li@linux.dev \
    --cc=liam@infradead.org \
    --cc=lihongfu@kylinos.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=rppt@kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox