From: "David Hildenbrand (Arm)" <david@kernel.org>
To: "Liam R. Howlett" <liam@infradead.org>
Cc: Mike Rapoport <rppt@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
David Carlier <devnexen@gmail.com>,
Heechan Kang <gganji11@naver.com>,
Lorenzo Stoakes <ljs@kernel.org>,
Michael Bommarito <michael.bommarito@gmail.com>,
Peter Xu <peterx@redhat.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND] userfaultfd: snapshot VMA state across UFFDIO_COPY retry
Date: Tue, 26 May 2026 14:47:45 +0200 [thread overview]
Message-ID: <855a00a7-c1f4-4c6d-bd4a-f3ccb0eb1eab@kernel.org> (raw)
In-Reply-To: <z6t4kefzgrdiu4zurxt63f3qdyjbjsvgyjnpxjkufj546huf2s@hq6xghp5w4ns>
On 5/25/26 19:12, Liam R. Howlett wrote:
> On 26/05/20 04:38PM, David Hildenbrand (Arm) wrote:
>> On 5/20/26 16:12, Mike Rapoport wrote:
>>>
>>> Let me reiterate:
>>>
>>> A thread doing UFFDIO_COPY releases the VMA in mfill_copy_folio_retry(),
>>> re-gets the VMA and checks if the per-MM counter stayed the same.
>>>
>>> If another thread makes any change to VMA while mfill_copy_folio_retry()
>>> waits to re-get the VMA, the counter would be incremented by another
>>> thread. mfill_copy_folio_retry() will see the change after mfill_get_vma()
>>> and will bail out with -EAGAIN.
>>>
>>
>> Yeah.
>
> This isn't bulletproof anyways. The sequence count can wrap. So, if
> someone can replace the vma then cause the sequence counter wrap, then
> you can be fooled into thinking it's okay (we had this problem years ago
> with the vmacache using a 32 bit counter, iirc).
If you can get it to wrap for such short durations, then how would sequence
counters possibly work in any reasonable context?
--
Cheers,
David
next prev parent reply other threads:[~2026-05-26 12:47 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-19 5:25 Mike Rapoport
2026-05-19 5:36 ` David CARLIER
2026-05-20 12:40 ` Mike Rapoport
2026-05-20 11:09 ` David Hildenbrand (Arm)
2026-05-20 12:53 ` Mike Rapoport
2026-05-20 13:48 ` David Hildenbrand (Arm)
2026-05-20 14:03 ` David Hildenbrand (Arm)
2026-05-26 15:23 ` Lorenzo Stoakes
2026-05-20 14:12 ` Mike Rapoport
2026-05-20 14:38 ` David Hildenbrand (Arm)
2026-05-25 17:12 ` Liam R. Howlett
2026-05-26 12:47 ` David Hildenbrand (Arm) [this message]
2026-05-26 15:25 ` Lorenzo Stoakes
2026-05-26 19:06 ` Liam R. Howlett
2026-05-26 15:12 ` Lorenzo Stoakes
2026-05-26 17:30 ` Mike Rapoport
2026-05-27 16:08 ` Lorenzo Stoakes
2026-05-27 19:01 ` Mike Rapoport
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=855a00a7-c1f4-4c6d-bd4a-f3ccb0eb1eab@kernel.org \
--to=david@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=devnexen@gmail.com \
--cc=gganji11@naver.com \
--cc=liam@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=michael.bommarito@gmail.com \
--cc=peterx@redhat.com \
--cc=rppt@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
Powered by JetHome