From: Shuah Khan <skhan@linuxfoundation.org>
To: Muhammad Usama Anjum <usama.anjum@collabora.com>,
Andrew Morton <akpm@linux-foundation.org>,
Shuah Khan <shuah@kernel.org>
Cc: kernel@collabora.com, linux-mm@kvack.org,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH 2/2] kselftests: mm: Fail the test if userfaultfd syscall isn't found
Date: Thu, 12 Sep 2024 11:28:30 -0600 [thread overview]
Message-ID: <35f21581-71f3-4234-9b03-dd3e3bda664f@linuxfoundation.org> (raw)
In-Reply-To: <3b700650-159d-45ad-91a3-59fca3019766@linuxfoundation.org>
On 9/12/24 10:10, Shuah Khan wrote:
> On 9/12/24 04:31, Muhammad Usama Anjum wrote:
>> The userfaultfd is enabled in the config fragment of mm selftest suite.
>> It must always be present. If it isn't present, we should throw error
>> and not just skip. This would have helped us catch the test breakage.
>
> Please elaborate on this to help understand the what breakage was
> missed.
>
> Also this commit log doesn't look right to me. syscall() could
> fail for any reason. Do you mean to see skip is incorrect in this
> error leg? Please see comments below.
>
>> Adding this now to catch the future breakages.
>>
>> Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
>> ---
>> tools/testing/selftests/mm/pagemap_ioctl.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/tools/testing/selftests/mm/pagemap_ioctl.c b/tools/testing/selftests/mm/pagemap_ioctl.c
>> index bcc73b4e805c6..d83dda8edf62c 100644
>> --- a/tools/testing/selftests/mm/pagemap_ioctl.c
>> +++ b/tools/testing/selftests/mm/pagemap_ioctl.c
>> @@ -95,7 +95,7 @@ int init_uffd(void)
>> uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK | UFFD_USER_MODE_ONLY);
>> if (uffd == -1)
>> - return uffd;
>> + ksft_exit_fail_perror("Userfaultfd syscall failed");
>
> This looks wrong to me - Is missing config the only reason this syscall
> would fail?
It should still skip if __NR_userfaultfd isn't supported on a release
or an architecture.
The real problem seems to be in main():
if (init_uffd())
ksft_exit_pass();
Why is this ksft_exit_pass()? Looks like further investigation is
necessary to understand the problem and fix.
thanks,
-- Shuah
next prev parent reply other threads:[~2024-09-12 17:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-12 10:31 [PATCH 1/2] kselftests: mm: Fix wrong __NR_userfaultfd value Muhammad Usama Anjum
2024-09-12 10:31 ` [PATCH 2/2] kselftests: mm: Fail the test if userfaultfd syscall isn't found Muhammad Usama Anjum
2024-09-12 16:10 ` Shuah Khan
2024-09-12 17:28 ` Shuah Khan [this message]
2024-09-16 6:33 ` Muhammad Usama Anjum
2024-09-12 15:44 ` [PATCH 1/2] kselftests: mm: Fix wrong __NR_userfaultfd value Shuah Khan
2024-09-16 6:32 ` Muhammad Usama Anjum
2024-09-17 1:56 ` Shuah Khan
2024-09-18 5:46 ` Muhammad Usama Anjum
2024-09-18 5:46 ` Muhammad Usama Anjum
2024-09-20 14:59 ` Shuah Khan
2024-09-23 5:35 ` Muhammad Usama Anjum
2024-09-23 16:02 ` Shuah Khan
2024-09-24 6:21 ` Muhammad Usama Anjum
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=35f21581-71f3-4234-9b03-dd3e3bda664f@linuxfoundation.org \
--to=skhan@linuxfoundation.org \
--cc=akpm@linux-foundation.org \
--cc=kernel@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=shuah@kernel.org \
--cc=usama.anjum@collabora.com \
/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