Linux-kselftest Archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: David Hildenbrand <david@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	linux-kselftest@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Shuah Khan <shuah@kernel.org>
Subject: Re: [PATCH v1] selftests: mm: gup_longterm: test unsharing logic when R/O pinning
Date: Tue, 30 Apr 2024 09:36:05 -0400	[thread overview]
Message-ID: <ZjDzxcrP_tDxo-X6@x1n> (raw)
In-Reply-To: <20240430131508.86924-1-david@redhat.com>

On Tue, Apr 30, 2024 at 03:15:08PM +0200, David Hildenbrand wrote:
> In our FOLL_LONGTERM tests, we prefault the page tables for the GUP-fast
> test cases to be able to find a PTE and exercise the "longterm pinning
> allowed" logic on the GUP-fast path where possible.
> 
> For now, we always prefault the page tables writable, resulting in PTEs
> that are writable.
> 
> Let's cover more cases to also test if our unsharing logic works as
> expected (and is able to make progress when there is nothing to unshare)
> by mprotect'ing the range R/O when R/O-pinning, so we don't get PTEs
> that are writable.
> 
> This change would have found an issue introduced by commit a12083d721d7
> ("mm/gup: handle hugepd for follow_page()"), whereby R/O pinning was not
> able to make progress in all cases, because unsharing logic was not
> provided with the VMA to decide at some point that long-term R/O pinning
> a !anon page is fine.
> 
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Shuah Khan <shuah@kernel.org>
> Cc: Peter Xu <peterx@redhat.com>
> Signed-off-by: David Hildenbrand <david@redhat.com>

Acked-by: Peter Xu <peterx@redhat.com>

Thanks,

-- 
Peter Xu


      reply	other threads:[~2024-04-30 13:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-30 13:15 [PATCH v1] selftests: mm: gup_longterm: test unsharing logic when R/O pinning David Hildenbrand
2024-04-30 13:36 ` Peter Xu [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=ZjDzxcrP_tDxo-X6@x1n \
    --to=peterx@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=shuah@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).