From: David Hildenbrand <david@redhat.com>
To: Li Wang <liwang@redhat.com>,
akpm@linux-foundation.org, peterx@redhat.com,
linux-kselftest@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Cc: Nadav Amit <nadav.amit@gmail.com>,
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>
Subject: Re: [PATCH v3] selftests/mm: Fix UFFDIO_API usage with proper two-step feature negotiation
Date: Tue, 8 Jul 2025 17:29:21 +0200 [thread overview]
Message-ID: <34344793-128c-445b-9ef4-853c98f3d5a8@redhat.com> (raw)
In-Reply-To: <20250625004645.400520-1-liwang@redhat.com>
> Key changes:
>
> 1. Use features=0 in the initial UFFDIO_API call to query supported
> feature bits, rather than immediately requesting WP support.
>
> 2. Skip the test gracefully if:
> - UFFDIO_API fails with EINVAL (e.g. unsupported API version), or
> - UFFD_FEATURE_PAGEFAULT_FLAG_WP is not advertised by the kernel.
>
> 3. Close the initial userfaultfd and create a new one before enabling
> the required feature, since UFFDIO_API can only be called once per fd.
>
> 4. Improve diagnostics by distinguishing between expected and unexpected
> failures, using strerror() to report errors.
>
> This ensures the test behaves correctly across a wider range of kernel
> versions and configurations, while preserving the intended behavior on
> kernels that support UFFD-WP.
>
> Suggestted-by: David Hildenbrand <david@redhat.com>
Skimming over this once again ... sorry.
Nit:
"Suggested-by:"
Likely Andrew can fix it up ... if the patch is not upstream yet (did
not check).
--
Cheers,
David / dhildenb
prev parent reply other threads:[~2025-07-08 15:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-25 0:46 [PATCH v3] selftests/mm: Fix UFFDIO_API usage with proper two-step feature negotiation Li Wang
2025-07-08 15:29 ` David Hildenbrand [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=34344793-128c-445b-9ef4-853c98f3d5a8@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=aruna.ramakrishna@oracle.com \
--cc=bagasdotme@gmail.com \
--cc=catalin.marinas@arm.com \
--cc=dave.hansen@linux.intel.com \
--cc=hannes@cmpxchg.org \
--cc=joey.gouly@arm.com \
--cc=keith.lucas@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=liwang@redhat.com \
--cc=nadav.amit@gmail.com \
--cc=peterx@redhat.com \
--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).