The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Dev Jain <dev.jain@arm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: david@kernel.org, ljs@kernel.org, liam@infradead.org,
	vbabka@kernel.org, rppt@kernel.org, surenb@google.com,
	mhocko@suse.com, kasong@tencent.com, qi.zheng@linux.dev,
	shakeel.butt@linux.dev, baohua@kernel.org,
	axelrasmussen@google.com, yuanchu@google.com, weixugc@google.com,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	riel@surriel.com, harry@kernel.org, jannh@google.com,
	lance.yang@linux.dev, ryan.roberts@arm.com,
	anshuman.khandual@arm.com
Subject: Re: [PATCH 0/3] Batch unmap of uffd-wp file folios
Date: Thu, 16 Jul 2026 10:27:05 +0530	[thread overview]
Message-ID: <fd8dcefc-e202-495b-9190-11c04ef2ac08@arm.com> (raw)
In-Reply-To: <20260715115852.a32e472d97fa182d6a5ee482@linux-foundation.org>



On 16/07/26 12:28 am, Andrew Morton wrote:
> On Wed, 15 Jul 2026 11:18:33 +0000 Dev Jain <dev.jain@arm.com> wrote:
> 
>> Currently, batched unmapping is supported if:
>>
>> 1) folio is a file folio, not belonging to uffd-wp VMA
>> 2) folio is anonymous and not swapbacked (lazyfree), not belonging to
>>    uffd-wp VMA
>>
>> So the cases which are not supported are
>>
>> 1) folio belonging to uffd-wp VMA
>> 2) folio is anonymous and swapbacked
>>
>> It is easy to see that this adds a lot of cognitive load while reading
>> try_to_unmap_one - we need to remember throughout whether nr_pages == 1
>> or > 1.
>>
>> The uffd-wp handling in try_to_unmap_one is regarding preserving the
>> uffd-wp state for file folios via pte_install_uffd_wp_if_needed (for anon
>> folio, we handle that while constructing the swap pte).
>>
>> Stop special casing on uffd-wp VMAs by simply adding batching support
>> to pte_install_uffd_wp_if_needed.
> 
> Thanks, I'll await reviewer input on this.
> 
> Sashiko might have found a pre-existing issue:
> 	https://sashiko.dev/#/patchset/20260715111839.1667914-1-dev.jain@arm.com

That was unexpected from Sashiko.

"When a large folio registered with uffd-wp is unmapped via
try_to_unmap_one(), folio_unmap_pte_batch() batches and clears multiple PTEs."

At patch 2, there is no batching support yet for uffd-wp folios.


      reply	other threads:[~2026-07-16  4:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-15 11:18 [PATCH 0/3] Batch unmap of uffd-wp file folios Dev Jain
2026-07-15 11:18 ` [PATCH 1/3] mm/memory: move pte_install_uffd_wp_if_needed() into memory.c Dev Jain
2026-07-16  9:35   ` David Hildenbrand (Arm)
2026-07-16 10:06     ` Dev Jain
2026-07-15 11:18 ` [PATCH 2/3] mm/memory: batch set uffd-wp markers during zapping Dev Jain
2026-07-16  9:41   ` David Hildenbrand (Arm)
2026-07-16 10:08     ` Dev Jain
2026-07-15 11:18 ` [PATCH 3/3] mm/rmap: batch unmap file folios belonging to uffd-wp VMAs Dev Jain
2026-07-16  9:44   ` David Hildenbrand (Arm)
2026-07-15 18:58 ` [PATCH 0/3] Batch unmap of uffd-wp file folios Andrew Morton
2026-07-16  4:57   ` Dev Jain [this message]

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=fd8dcefc-e202-495b-9190-11c04ef2ac08@arm.com \
    --to=dev.jain@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=anshuman.khandual@arm.com \
    --cc=axelrasmussen@google.com \
    --cc=baohua@kernel.org \
    --cc=david@kernel.org \
    --cc=harry@kernel.org \
    --cc=jannh@google.com \
    --cc=kasong@tencent.com \
    --cc=lance.yang@linux.dev \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mhocko@suse.com \
    --cc=qi.zheng@linux.dev \
    --cc=riel@surriel.com \
    --cc=rppt@kernel.org \
    --cc=ryan.roberts@arm.com \
    --cc=shakeel.butt@linux.dev \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    --cc=weixugc@google.com \
    --cc=yuanchu@google.com \
    /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