linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests/mm: Deduplicate test logging in test_mlock_lock()
@ 2025-05-15  9:27 Mark Brown
  2025-05-15  9:30 ` Dev Jain
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Brown @ 2025-05-15  9:27 UTC (permalink / raw)
  To: Andrew Morton, Shuah Khan
  Cc: linux-mm, linux-kselftest, linux-kernel, Mark Brown

The mlock2-tests test_mlock_lock() test reports two test results with
an identical string, one reporitng if it successfully locked a block of
memory and another reporting if the lock is still present after doing an
unlock (following a similar pattern to other tests in the same program).
This confuses test automation since the test string is used to deduplicate
tests, change the post unlock test to report "Unlocked" instead like the
other tests to fix this.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 tools/testing/selftests/mm/mlock2-tests.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/mm/mlock2-tests.c b/tools/testing/selftests/mm/mlock2-tests.c
index 7f0d50fa361d..3e90ff37e336 100644
--- a/tools/testing/selftests/mm/mlock2-tests.c
+++ b/tools/testing/selftests/mm/mlock2-tests.c
@@ -196,7 +196,7 @@ static void test_mlock_lock(void)
 		ksft_exit_fail_msg("munlock(): %s\n", strerror(errno));
 	}
 
-	ksft_test_result(!unlock_lock_check(map), "%s: Locked\n", __func__);
+	ksft_test_result(!unlock_lock_check(map), "%s: Unlocked\n", __func__);
 	munmap(map, 2 * page_size);
 }
 

---
base-commit: 82f2b0b97b36ee3fcddf0f0780a9a0825d52fec3
change-id: 20250514-selftest-mm-mlock2-dup-277d586bb29d

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



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

* Re: [PATCH] selftests/mm: Deduplicate test logging in test_mlock_lock()
  2025-05-15  9:27 [PATCH] selftests/mm: Deduplicate test logging in test_mlock_lock() Mark Brown
@ 2025-05-15  9:30 ` Dev Jain
  0 siblings, 0 replies; 2+ messages in thread
From: Dev Jain @ 2025-05-15  9:30 UTC (permalink / raw)
  To: Mark Brown, Andrew Morton, Shuah Khan
  Cc: linux-mm, linux-kselftest, linux-kernel



On 15/05/25 2:57 pm, Mark Brown wrote:
> The mlock2-tests test_mlock_lock() test reports two test results with
> an identical string, one reporitng if it successfully locked a block of
> memory and another reporting if the lock is still present after doing an
> unlock (following a similar pattern to other tests in the same program).
> This confuses test automation since the test string is used to deduplicate
> tests, change the post unlock test to report "Unlocked" instead like the
> other tests to fix this.
> 
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
>   tools/testing/selftests/mm/mlock2-tests.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/mm/mlock2-tests.c b/tools/testing/selftests/mm/mlock2-tests.c
> index 7f0d50fa361d..3e90ff37e336 100644
> --- a/tools/testing/selftests/mm/mlock2-tests.c
> +++ b/tools/testing/selftests/mm/mlock2-tests.c
> @@ -196,7 +196,7 @@ static void test_mlock_lock(void)
>   		ksft_exit_fail_msg("munlock(): %s\n", strerror(errno));
>   	}
>   
> -	ksft_test_result(!unlock_lock_check(map), "%s: Locked\n", __func__);
> +	ksft_test_result(!unlock_lock_check(map), "%s: Unlocked\n", __func__);
>   	munmap(map, 2 * page_size);
>   }
>   

Acked-by: Dev Jain <dev.jain@arm.com>

> 
> ---
> base-commit: 82f2b0b97b36ee3fcddf0f0780a9a0825d52fec3
> change-id: 20250514-selftest-mm-mlock2-dup-277d586bb29d
> 
> Best regards,



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

end of thread, other threads:[~2025-05-15  9:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-15  9:27 [PATCH] selftests/mm: Deduplicate test logging in test_mlock_lock() Mark Brown
2025-05-15  9:30 ` Dev Jain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox