linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests/mm: Skip failed memfd setups in gup_longterm
@ 2025-06-05 21:34 Mark Brown
  2025-06-06  1:04 ` Andrew Morton
  2025-06-06 10:23 ` Lorenzo Stoakes
  0 siblings, 2 replies; 4+ messages in thread
From: Mark Brown @ 2025-06-05 21:34 UTC (permalink / raw)
  To: Andrew Morton, Shuah Khan, David Hildenbrand
  Cc: Lorenzo Stoakes, linux-mm, linux-kselftest, linux-kernel,
	Mark Brown

Unlike the other cases gup_longterm's memfd tests previously skipped the
test when failing to set up the file descriptor to test, restore this
behaviour.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 tools/testing/selftests/mm/gup_longterm.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/mm/gup_longterm.c b/tools/testing/selftests/mm/gup_longterm.c
index 8a97ac5176a4..29047d2e0c49 100644
--- a/tools/testing/selftests/mm/gup_longterm.c
+++ b/tools/testing/selftests/mm/gup_longterm.c
@@ -298,8 +298,11 @@ static void run_with_memfd(test_fn fn, const char *desc)
 	log_test_start("%s ... with memfd", desc);
 
 	fd = memfd_create("test", 0);
-	if (fd < 0)
+	if (fd < 0) {
 		ksft_print_msg("memfd_create() failed (%s)\n", strerror(errno));
+		log_test_result(KSFT_SKIP);
+		return;
+	}
 
 	fn(fd, pagesize);
 	close(fd);
@@ -366,6 +369,8 @@ static void run_with_memfd_hugetlb(test_fn fn, const char *desc,
 	fd = memfd_create("test", flags);
 	if (fd < 0) {
 		ksft_print_msg("memfd_create() failed (%s)\n", strerror(errno));
+		log_test_result(KSFT_SKIP);
+		return;
 	}
 
 	fn(fd, hugetlbsize);

---
base-commit: ec7714e4947909190ffb3041a03311a975350fe0
change-id: 20250603-selftest-mm-gup-longterm-tweaks-e685a8ae9751

Best regards,
-- 
Mark Brown <broonie@kernel.org>



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] selftests/mm: Skip failed memfd setups in gup_longterm
  2025-06-05 21:34 [PATCH] selftests/mm: Skip failed memfd setups in gup_longterm Mark Brown
@ 2025-06-06  1:04 ` Andrew Morton
  2025-06-06 10:30   ` David Hildenbrand
  2025-06-06 10:23 ` Lorenzo Stoakes
  1 sibling, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2025-06-06  1:04 UTC (permalink / raw)
  To: Mark Brown
  Cc: Shuah Khan, David Hildenbrand, Lorenzo Stoakes, linux-mm,
	linux-kselftest, linux-kernel

On Thu, 05 Jun 2025 22:34:31 +0100 Mark Brown <broonie@kernel.org> wrote:

> Unlike the other cases gup_longterm's memfd tests previously skipped the
> test when failing to set up the file descriptor to test, restore this
> behaviour.
> 
> Signed-off-by: Mark Brown <broonie@kernel.org>

I added a bunch of stuff to this.  Please check?


From: Mark Brown <broonie@kernel.org>
Subject: selftests/mm: skip failed memfd setups in gup_longterm
Date: Thu, 05 Jun 2025 22:34:31 +0100

Unlike the other cases gup_longterm's memfd tests previously skipped the
test when failing to set up the file descriptor to test.  Restore this
behavior to avoid hitting failures when hugetlb isn't configured.

Link: https://lkml.kernel.org/r/20250605-selftest-mm-gup-longterm-tweaks-v1-1-2fae34b05958@kernel.org
Fies: 66bce7afbaca ("selftests/mm: fix test result reporting in gup_longterm")
Signed-off-by: Mark Brown <broonie@kernel.org>
Reported-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Closes: https://lkml.kernel.org/r/a76fc252-0fe3-4d4b-a9a1-4a2895c2680d@lucifer.local
Cc: David Hildenbrand <david@redhat.com>
Cc: Shuah Khan <shuah@kernel.org>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] selftests/mm: Skip failed memfd setups in gup_longterm
  2025-06-05 21:34 [PATCH] selftests/mm: Skip failed memfd setups in gup_longterm Mark Brown
  2025-06-06  1:04 ` Andrew Morton
@ 2025-06-06 10:23 ` Lorenzo Stoakes
  1 sibling, 0 replies; 4+ messages in thread
From: Lorenzo Stoakes @ 2025-06-06 10:23 UTC (permalink / raw)
  To: Mark Brown
  Cc: Andrew Morton, Shuah Khan, David Hildenbrand, linux-mm,
	linux-kselftest, linux-kernel

On Thu, Jun 05, 2025 at 10:34:31PM +0100, Mark Brown wrote:
> Unlike the other cases gup_longterm's memfd tests previously skipped the
> test when failing to set up the file descriptor to test, restore this
> behaviour.
>
> Signed-off-by: Mark Brown <broonie@kernel.org>

Thanks, LGTM. I tested locally and this resolves the issue, appreciate it!

Feel free to add:

Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Tested-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>

> ---
>  tools/testing/selftests/mm/gup_longterm.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/mm/gup_longterm.c b/tools/testing/selftests/mm/gup_longterm.c
> index 8a97ac5176a4..29047d2e0c49 100644
> --- a/tools/testing/selftests/mm/gup_longterm.c
> +++ b/tools/testing/selftests/mm/gup_longterm.c
> @@ -298,8 +298,11 @@ static void run_with_memfd(test_fn fn, const char *desc)
>  	log_test_start("%s ... with memfd", desc);
>
>  	fd = memfd_create("test", 0);
> -	if (fd < 0)
> +	if (fd < 0) {
>  		ksft_print_msg("memfd_create() failed (%s)\n", strerror(errno));
> +		log_test_result(KSFT_SKIP);
> +		return;
> +	}
>
>  	fn(fd, pagesize);
>  	close(fd);
> @@ -366,6 +369,8 @@ static void run_with_memfd_hugetlb(test_fn fn, const char *desc,
>  	fd = memfd_create("test", flags);
>  	if (fd < 0) {
>  		ksft_print_msg("memfd_create() failed (%s)\n", strerror(errno));
> +		log_test_result(KSFT_SKIP);
> +		return;
>  	}
>
>  	fn(fd, hugetlbsize);
>
> ---
> base-commit: ec7714e4947909190ffb3041a03311a975350fe0
> change-id: 20250603-selftest-mm-gup-longterm-tweaks-e685a8ae9751
>
> Best regards,
> --
> Mark Brown <broonie@kernel.org>
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] selftests/mm: Skip failed memfd setups in gup_longterm
  2025-06-06  1:04 ` Andrew Morton
@ 2025-06-06 10:30   ` David Hildenbrand
  0 siblings, 0 replies; 4+ messages in thread
From: David Hildenbrand @ 2025-06-06 10:30 UTC (permalink / raw)
  To: Andrew Morton, Mark Brown
  Cc: Shuah Khan, Lorenzo Stoakes, linux-mm, linux-kselftest,
	linux-kernel

On 06.06.25 03:04, Andrew Morton wrote:
> On Thu, 05 Jun 2025 22:34:31 +0100 Mark Brown <broonie@kernel.org> wrote:
> 
>> Unlike the other cases gup_longterm's memfd tests previously skipped the
>> test when failing to set up the file descriptor to test, restore this
>> behaviour.
>>
>> Signed-off-by: Mark Brown <broonie@kernel.org>
> 
> I added a bunch of stuff to this.  Please check?
> 
> 
> From: Mark Brown <broonie@kernel.org>
> Subject: selftests/mm: skip failed memfd setups in gup_longterm
> Date: Thu, 05 Jun 2025 22:34:31 +0100
> 
> Unlike the other cases gup_longterm's memfd tests previously skipped the
> test when failing to set up the file descriptor to test.  Restore this
> behavior to avoid hitting failures when hugetlb isn't configured.
> 
> Link: https://lkml.kernel.org/r/20250605-selftest-mm-gup-longterm-tweaks-v1-1-2fae34b05958@kernel.org
> Fies: 66bce7afbaca ("selftests/mm: fix test result reporting in gup_longterm")

"Fixes:"

> Signed-off-by: Mark Brown <broonie@kernel.org>
> Reported-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
> Closes: https://lkml.kernel.org/r/a76fc252-0fe3-4d4b-a9a1-4a2895c2680d@lucifer.local
> Cc: David Hildenbrand <david@redhat.com>
> Cc: Shuah Khan <shuah@kernel.org>
> 

Acked-by: David Hildenbrand <david@redhat.com>

-- 
Cheers,

David / dhildenb



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-06-06 10:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-05 21:34 [PATCH] selftests/mm: Skip failed memfd setups in gup_longterm Mark Brown
2025-06-06  1:04 ` Andrew Morton
2025-06-06 10:30   ` David Hildenbrand
2025-06-06 10:23 ` Lorenzo Stoakes

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).