From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Richard Cheng <icheng@nvidia.com>, akpm@linux-foundation.org
Cc: jgg@ziepe.ca, jhubbard@nvidia.com, peterx@redhat.com,
linux-mm@kvack.org, linux-kernel@vger.kernel.org, ljs@kernel.org,
liam@infradead.org, vbabka@kernel.org, rppt@kernel.org,
surenb@google.com, mhocko@suse.com, shuah@kernel.org,
linux-kselftest@vger.kernel.org, kobak@nvidia.com,
kaihengf@nvidia.com, newtonl@nvidia.com, kristinc@nvidia.com
Subject: Re: [RFC PATCH 1/2] mm/gup_test: Track long-term pins per open file
Date: Mon, 21 Sep 2026 12:26:20 +0200 [thread overview]
Message-ID: <b51234d8-467b-47c4-9d94-82e589643859@kernel.org> (raw)
In-Reply-To: <20260921094243.64698-2-icheng@nvidia.com>
On 9/21/26 11:42, Richard Cheng wrote:
> Long-term pin state is currently global, allowing one gup_test file
> descriptor to block, stop, or release pins owned by another client.
>
> Allocate the pin state for each open file and store it in
> file->private_data. Serialize START, READ, and STOP with the per-open
> mutex, and release only the pages owned by that file.
>
> Descriptors duplicated through dup() or fork() continue sharing state
> because they reference the same struct file. Keep the ioctl ABI and
> same-file duplicate START behavior unchanged.
>
> Reviewed-by: Koba Ko <kobak@nvidia.com>
> Signed-off-by: Richard Cheng <icheng@nvidia.com>
commit 534b19bbb67717eea2272573bc0ff7ba4ba109c1
Author: David Hildenbrand (Arm) <david@kernel.org>
Date: Mon Aug 10 13:31:14 2026 +0200
mm/gup_test: keep longterm pin state per file
The pin longterm test currently stores its data globally, shared among
multiple concurrent users of the interface (multiple open file descriptors
-> multiple "struct file"'s). That makes the gup_test interface
problematic to use concurrently: two users, such as concurrent selftest
runs, can interfere with the same longterm pin state.
While this has not been observed as a problem so far in practice, let's
just handle it cleanly. There could be a way to trigger selftest failures
by e.g., running the cow.c and gup_longerm.c selftests concurrently, but
we usually run them sequentially. Let's add a "Fixes" tag to be safe, but
not need to CC stable.
Which is already upstream.
--
Cheers,
David
next prev parent reply other threads:[~2026-09-21 10:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-21 9:42 [RFC PATCH 0/2] Fix gup_test long-term pin ownership Richard Cheng
2026-09-21 9:42 ` [RFC PATCH 1/2] mm/gup_test: Track long-term pins per open file Richard Cheng
2026-09-21 10:26 ` David Hildenbrand (Arm) [this message]
2026-09-21 9:42 ` [RFC PATCH 2/2] selftests/mm: Test per-open gup_test pin ownership Richard Cheng
2026-09-21 10:28 ` David Hildenbrand (Arm)
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=b51234d8-467b-47c4-9d94-82e589643859@kernel.org \
--to=david@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=icheng@nvidia.com \
--cc=jgg@ziepe.ca \
--cc=jhubbard@nvidia.com \
--cc=kaihengf@nvidia.com \
--cc=kobak@nvidia.com \
--cc=kristinc@nvidia.com \
--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=newtonl@nvidia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®