All of lore.kernel.org
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Donggeun Yoo <donggeunyoo.kernel@gmail.com>,
	akpm@linux-foundation.org, rppt@kernel.org
Cc: peterx@redhat.com, surenb@google.com, aarcange@redhat.com,
	ljs@kernel.org, liam@infradead.org, vbabka@kernel.org,
	mhocko@suse.com, shuah@kernel.org, kirill@shutemov.name,
	linux-mm@kvack.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/2] selftests/mm: add tests for UFFDIO_MOVE of a uffd-protected swap entry
Date: Mon, 28 Sep 2026 10:53:49 +0200	[thread overview]
Message-ID: <4facb8d8-2ccc-4337-bdbf-3e8c03351b7e@kernel.org> (raw)
In-Reply-To: <4e4223f4-dfec-4e82-97fe-25ae3a3b0f73@kernel.org>

On 9/28/26 10:53, David Hildenbrand (Arm) wrote:
> On 9/26/26 14:41, Donggeun Yoo wrote:
>> Move a swapped-out page out of a write-protected or RWP-protected area into
>> a destination registered for missing faults only, and read pagemap bit 57
>> at the destination.  The destination was never protected, so the bit must
>> be clear.
>>
>> Assisted-by: LLM
>> Signed-off-by: Donggeun Yoo <donggeunyoo.kernel@gmail.com>
>> ---
>>  tools/testing/selftests/mm/uffd-unit-tests.c | 84 ++++++++++++++++++++
>>  1 file changed, 84 insertions(+)
>>
>> diff --git a/tools/testing/selftests/mm/uffd-unit-tests.c b/tools/testing/selftests/mm/uffd-unit-tests.c
>> index ef9b3956bdcfd..580178630eded 100644
>> --- a/tools/testing/selftests/mm/uffd-unit-tests.c
>> +++ b/tools/testing/selftests/mm/uffd-unit-tests.c
>> @@ -2037,6 +2037,75 @@ static void uffd_move_pmd_split_test(uffd_global_test_opts_t *gopts, uffd_test_a
>>  			      uffd_move_pmd_handle_fault);
>>  }
>>  
>> +/*
>> + * Moving a swapped-out page out of a write-protected or RWP-protected area
>> + * must not carry the uffd bit into a destination registered for missing
>> + * faults only: such a bit is never cleared afterwards, so pagemap keeps
>> + * reporting the page as uffd-tracked.
>> + *
>> + * Needs a swap device; skipped if MADV_PAGEOUT cannot evict the page.
>> + */
>> +static void uffd_move_swap_test_common(uffd_global_test_opts_t *gopts,
>> +				       bool rwp)
>> +{
>> +	unsigned long page_size = gopts->page_size;
>> +	struct uffdio_move move = { };
>> +	int pagemap_fd;
>> +
>> +	if (rwp) {
>> +		if (uffd_register_rwp(gopts->uffd, gopts->area_src, page_size))
>> +			err("register src failure");
>> +	} else if (uffd_register(gopts->uffd, gopts->area_src, page_size,
>> +				 false, true, false)) {
>> +		err("register src failure");
>> +	}
> 
> if ()

Clicked sent by accident ... let me reply once more.

-- 
Cheers,

David

  reply	other threads:[~2026-09-28  8:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-26 12:41 [PATCH v3 0/2] userfaultfd: clear the inherited uffd bit in move_swap_pte() Donggeun Yoo
2026-09-26 12:41 ` [PATCH v3 1/2] " Donggeun Yoo
2026-09-27 20:54   ` Andrew Morton
2026-09-28  7:33     ` David Hildenbrand (Arm)
2026-10-02  8:18   ` Mike Rapoport
2026-09-26 12:41 ` [PATCH v3 2/2] selftests/mm: add tests for UFFDIO_MOVE of a uffd-protected swap entry Donggeun Yoo
2026-09-28  8:53   ` David Hildenbrand (Arm)
2026-09-28  8:53     ` David Hildenbrand (Arm) [this message]
2026-09-28  9:11   ` David Hildenbrand (Arm)
2026-09-29  0:20     ` Donggeun Yoo

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=4facb8d8-2ccc-4337-bdbf-3e8c03351b7e@kernel.org \
    --to=david@kernel.org \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=donggeunyoo.kernel@gmail.com \
    --cc=kirill@shutemov.name \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mhocko@suse.com \
    --cc=peterx@redhat.com \
    --cc=rppt@kernel.org \
    --cc=shuah@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.