From: Peter Xu <peterx@redhat.com>
To: David Hildenbrand <david@redhat.com>
Cc: Nadav Amit <nadav.amit@gmail.com>,
Axel Rasmussen <axelrasmussen@google.com>,
Li Wang <liwang@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kselftest@vger.kernel.org,
"open list:MEMORY MANAGEMENT" <linux-mm@kvack.org>,
Aruna Ramakrishna <aruna.ramakrishna@oracle.com>,
Bagas Sanjaya <bagasdotme@gmail.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
Joey Gouly <joey.gouly@arm.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Keith Lucas <keith.lucas@oracle.com>,
Ryan Roberts <ryan.roberts@arm.com>,
Shuah Khan <shuah@kernel.org>, Mike Rapoport <rppt@kernel.org>
Subject: Re: [PATCH v2] selftests/mm: Fix UFFDIO_API usage with proper two-step feature negotiation
Date: Tue, 24 Jun 2025 11:03:36 -0400 [thread overview]
Message-ID: <aFq-SAFB3eWdwwwf@x1.local> (raw)
In-Reply-To: <495dc88a-c0b2-4090-a89c-00f000b62a2f@redhat.com>
On Tue, Jun 24, 2025 at 01:48:50PM +0200, David Hildenbrand wrote:
> The man page was updated with
>
> commit db3d5cc1a17b0ace008ebe1eaf0ac4d96b4b519a
> Author: Axel Rasmussen <axelrasmussen@google.com>
> Date: Tue Oct 3 12:45:44 2023 -0700
>
> ioctl_userfaultfd.2: Correct and update UFFDIO_API ioctl error codes
> First, it is not correct that repeated UFFDIO_API calls result in
> EINVAL. This is true *if both calls enable features*, but in the case
> where we're doing a two-step feature detection handshake, the kernel
> explicitly expects 2 calls (one with no features set). So, correct this
> description.
> Then, some new error cases have been added to the kernel recently, and
> the man page wasn't updated to note these. So, add in descriptions of
> these new error cases.
>
> @Axel, did you ignore the automatically-set UFFD_FEATURE_INITIALIZED and the
> repeated calls never worked, or was there actually a time where repeated
> UFFDIO_API calls would not result in EINVAL?
The man-pages was inaccurate before. It got updated recently after Kyle
asking similar questions, see:
http://www.alejandro-colomar.es/src/alx/linux/man-pages/man-pages.git/commit/?id=6a949e9b08fd1ad4e77584276b9566e45fc07a93
Li's v2 change on using the temp fd looks correct.
Thanks,
--
Peter Xu
next prev parent reply other threads:[~2025-06-24 15:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-22 8:10 [PATCH] mm/selftests: improve UFFD-WP feature detection in KSM test Li Wang
2025-06-23 8:33 ` David Hildenbrand
2025-06-24 3:43 ` Li Wang
2025-06-24 4:24 ` [PATCH v2] selftests/mm: Fix UFFDIO_API usage with proper two-step feature negotiation Li Wang
2025-06-24 8:07 ` David Hildenbrand
2025-06-24 8:22 ` David Hildenbrand
2025-06-24 11:29 ` Nadav Amit
2025-06-24 11:39 ` David Hildenbrand
2025-06-24 11:48 ` David Hildenbrand
2025-06-24 15:03 ` Peter Xu [this message]
2025-06-24 15:17 ` David Hildenbrand
2025-06-24 15:17 ` David Hildenbrand
2025-06-25 0:34 ` Li Wang
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=aFq-SAFB3eWdwwwf@x1.local \
--to=peterx@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=aruna.ramakrishna@oracle.com \
--cc=axelrasmussen@google.com \
--cc=bagasdotme@gmail.com \
--cc=catalin.marinas@arm.com \
--cc=dave.hansen@linux.intel.com \
--cc=david@redhat.com \
--cc=hannes@cmpxchg.org \
--cc=joey.gouly@arm.com \
--cc=keith.lucas@oracle.com \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=liwang@redhat.com \
--cc=nadav.amit@gmail.com \
--cc=rppt@kernel.org \
--cc=ryan.roberts@arm.com \
--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 NNTP newsgroup(s).