From: David Hildenbrand <david@redhat.com>
To: Dev Jain <dev.jain@arm.com>, akpm@linux-foundation.org
Cc: lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com,
vbabka@suse.cz, rppt@kernel.org, surenb@google.com,
mhocko@suse.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org,
Lokesh Gidra <lokeshgidra@google.com>
Subject: Re: [PATCH] mm: move rmap of mTHP upon CoW reuse
Date: Thu, 25 Sep 2025 12:37:42 +0200 [thread overview]
Message-ID: <462bb4e3-7a38-4155-9f95-52fbb4b6d464@redhat.com> (raw)
In-Reply-To: <45e08ee0-c85e-469e-a3eb-4ca2e8b7ec0c@arm.com>
On 25.09.25 12:33, Dev Jain wrote:
>
> On 25/09/25 2:46 pm, David Hildenbrand wrote:
>> On 25.09.25 10:54, Dev Jain wrote:
>>> At wp-fault time, when we find that a folio is exclusively mapped, we
>>> move
>>> folio->mapping to the faulting VMA's anon_vma, so that rmap overhead
>>> reduces. This is currently done for small folios (base pages) and
>>> PMD-mapped THPs. Do this for mTHP too.
>>
>> I deliberately didn't add this back then because I was not able to
>> convince myself easily that it is ok in all corner cases. So this
>> needs some thought.
>
> Thanks for your detailed reply.
>
>
>>
>>
>> We know that the folio is exclusively mapped to a single MM and that
>> there are no unexpected references from others (GUP pins, whatsoever).
>>
>> But a large folio might be
>>
>> (a) mapped into multiple VMAs (e.g., partial mprotect()) in the same MM
>
> I think we have the same problem then for PMD-THPs? I see that
> vma_adjust_trans_huge() only does a PMD split and not folio split.
Sure, we can end up in this reuse function here for any large anon
folio, including PMD ones after a PMD->PTE remapping.
--
Cheers
David / dhildenb
next prev parent reply other threads:[~2025-09-25 10:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-25 8:54 Dev Jain
2025-09-25 9:16 ` David Hildenbrand
2025-09-25 10:33 ` Dev Jain
2025-09-25 10:37 ` David Hildenbrand [this message]
2025-09-25 10:50 ` Dev Jain
2025-09-25 10:57 ` David Hildenbrand
2025-09-25 9:31 ` Kiryl Shutsemau
2025-09-25 9:33 ` David Hildenbrand
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=462bb4e3-7a38-4155-9f95-52fbb4b6d464@redhat.com \
--to=david@redhat.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=dev.jain@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lokeshgidra@google.com \
--cc=lorenzo.stoakes@oracle.com \
--cc=mhocko@suse.com \
--cc=rppt@kernel.org \
--cc=surenb@google.com \
--cc=vbabka@suse.cz \
/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