From: Yuan-Hao Hsu <aa9736195201@gmail.com>
To: David Hildenbrand <david@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Lorenzo Stoakes <ljs@kernel.org>,
liam@infradead.org, Vlastimil Babka <vbabka@kernel.org>,
Mike Rapoport <rppt@kernel.org>,
Suren Baghdasaryan <surenb@google.com>,
Michal Hocko <mhocko@suse.com>, Barry Song <baohua@kernel.org>,
Ryan Roberts <ryan.roberts@arm.com>, Dev Jain <dev.jain@arm.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/memory: reuse the whole exclusive large folio on a write fault
Date: Sat, 19 Sep 2026 02:28:56 +0800 [thread overview]
Message-ID: <20260918182857.571-1-aa9736195201@gmail.com> (raw)
In-Reply-To: <b1ba175c-ceb2-4e00-b233-d51dd8a2f4cb@kernel.org>
On Fri, 18 Sep 2026 14:14:11 +0200, David Hildenbrand (Arm) wrote:
> There were previous discussions on this, in particular around how much
> we should actually try operating around the target PTE.
Yes, Barry's RFC from 2024 and your replies to it, where you were fine
with contpte granularity and not convinced about anything bigger. That
is why the description has the numbers for both: capped to 16 PTEs, the
1M and 2M cases take 5.4 ms instead of 3.9 ms, and the only pattern where
the cap wins is one store per 2M. If you would rather start with the
contpte-sized version, that is a two-line change and I can send that
version instead.
> How did you use the LLM for coming up with this patch + description?
I did the initial investigation and made the design decisions myself.
Once I had a clear idea of the approach and the overall structure, I used
an LLM to help with parts of the implementation and the test
programs. I also used it to help with drafting the commit message.
Before sending the patch, I went through it line by line and checked the
test results and measurements to make sure they matched what the code was
actually doing and that there were no obvious issues.
Lorenzo, for your bot's question: the reuse decision in
wp_can_reuse_anon_folio() is per folio. The patch applies it to the other
PTEs of the folio within the same VMA and page table using the mprotect
helpers (can_change_pte_writable() and modify_prot_*_ptes()), so
soft-dirty, uffd-wp and NUMA hinting PTEs are handled the way mprotect()
handles them, and the PTE that faulted is finished by wp_page_reuse() as
before.
The part I spent most of the time on was the measurements, including the
cases where it does not help.
Yuan-Hao Hsu
next prev parent reply other threads:[~2026-09-18 18:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-18 6:42 Yuan-Hao Hsu
2026-09-18 12:14 ` David Hildenbrand (Arm)
2026-09-18 18:28 ` Yuan-Hao Hsu [this message]
2026-09-18 23:48 ` Barry Song
2026-09-18 13:54 ` 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=20260918182857.571-1-aa9736195201@gmail.com \
--to=aa9736195201@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=david@kernel.org \
--cc=dev.jain@arm.com \
--cc=liam@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=mhocko@suse.com \
--cc=rppt@kernel.org \
--cc=ryan.roberts@arm.com \
--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
all inboxes | Powered by JetHome®