* [PATCH] selftests/mm: Deduplicate test names in madv_populate
@ 2025-05-22 16:29 Mark Brown
2025-05-22 18:59 ` Liam R. Howlett
2025-05-26 12:57 ` David Hildenbrand
0 siblings, 2 replies; 3+ messages in thread
From: Mark Brown @ 2025-05-22 16:29 UTC (permalink / raw)
To: Andrew Morton, Shuah Khan, David Hildenbrand
Cc: linux-mm, linux-kselftest, linux-kernel, Mark Brown
The madv_populate selftest has some repetitive code for several different
cases that it covers, included repeated test names used in ksft_test_result()
reports. This causes problems for automation, the test name is used to both
track the test between runs and distinguish between multiple tests within
the same run. Fix this by tweaking the messages with duplication to be more
specific about the contexts they're in.
Signed-off-by: Mark Brown <broonie@kernel.org>
---
tools/testing/selftests/mm/madv_populate.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/tools/testing/selftests/mm/madv_populate.c b/tools/testing/selftests/mm/madv_populate.c
index ef7d911da13e..b6fabd5c27ed 100644
--- a/tools/testing/selftests/mm/madv_populate.c
+++ b/tools/testing/selftests/mm/madv_populate.c
@@ -172,12 +172,12 @@ static void test_populate_read(void)
if (addr == MAP_FAILED)
ksft_exit_fail_msg("mmap failed\n");
ksft_test_result(range_is_not_populated(addr, SIZE),
- "range initially not populated\n");
+ "read range initially not populated\n");
ret = madvise(addr, SIZE, MADV_POPULATE_READ);
ksft_test_result(!ret, "MADV_POPULATE_READ\n");
ksft_test_result(range_is_populated(addr, SIZE),
- "range is populated\n");
+ "read range is populated\n");
munmap(addr, SIZE);
}
@@ -194,12 +194,12 @@ static void test_populate_write(void)
if (addr == MAP_FAILED)
ksft_exit_fail_msg("mmap failed\n");
ksft_test_result(range_is_not_populated(addr, SIZE),
- "range initially not populated\n");
+ "write range initially not populated\n");
ret = madvise(addr, SIZE, MADV_POPULATE_WRITE);
ksft_test_result(!ret, "MADV_POPULATE_WRITE\n");
ksft_test_result(range_is_populated(addr, SIZE),
- "range is populated\n");
+ "write range is populated\n");
munmap(addr, SIZE);
}
@@ -247,19 +247,19 @@ static void test_softdirty(void)
/* Clear any softdirty bits. */
clear_softdirty();
ksft_test_result(range_is_not_softdirty(addr, SIZE),
- "range is not softdirty\n");
+ "cleared range is not softdirty\n");
/* Populating READ should set softdirty. */
ret = madvise(addr, SIZE, MADV_POPULATE_READ);
- ksft_test_result(!ret, "MADV_POPULATE_READ\n");
+ ksft_test_result(!ret, "softdirty MADV_POPULATE_READ\n");
ksft_test_result(range_is_not_softdirty(addr, SIZE),
- "range is not softdirty\n");
+ "range is not softdirty after MADV_POPULATE_READ\n");
/* Populating WRITE should set softdirty. */
ret = madvise(addr, SIZE, MADV_POPULATE_WRITE);
- ksft_test_result(!ret, "MADV_POPULATE_WRITE\n");
+ ksft_test_result(!ret, "softdirty MADV_POPULATE_WRITE\n");
ksft_test_result(range_is_softdirty(addr, SIZE),
- "range is softdirty\n");
+ "range is softdirty after MADV_POPULATE_WRITE \n");
munmap(addr, SIZE);
}
---
base-commit: a5806cd506af5a7c19bcd596e4708b5c464bfd21
change-id: 20250521-selftests-mm-madv-populate-dedupe-95faf16c3c8f
Best regards,
--
Mark Brown <broonie@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] selftests/mm: Deduplicate test names in madv_populate
2025-05-22 16:29 [PATCH] selftests/mm: Deduplicate test names in madv_populate Mark Brown
@ 2025-05-22 18:59 ` Liam R. Howlett
2025-05-26 12:57 ` David Hildenbrand
1 sibling, 0 replies; 3+ messages in thread
From: Liam R. Howlett @ 2025-05-22 18:59 UTC (permalink / raw)
To: Mark Brown
Cc: Andrew Morton, Shuah Khan, David Hildenbrand, linux-mm,
linux-kselftest, linux-kernel
* Mark Brown <broonie@kernel.org> [250522 12:30]:
> The madv_populate selftest has some repetitive code for several different
> cases that it covers, included repeated test names used in ksft_test_result()
> reports. This causes problems for automation, the test name is used to both
> track the test between runs and distinguish between multiple tests within
> the same run. Fix this by tweaking the messages with duplication to be more
> specific about the contexts they're in.
>
> Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
> ---
> tools/testing/selftests/mm/madv_populate.c | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/tools/testing/selftests/mm/madv_populate.c b/tools/testing/selftests/mm/madv_populate.c
> index ef7d911da13e..b6fabd5c27ed 100644
> --- a/tools/testing/selftests/mm/madv_populate.c
> +++ b/tools/testing/selftests/mm/madv_populate.c
> @@ -172,12 +172,12 @@ static void test_populate_read(void)
> if (addr == MAP_FAILED)
> ksft_exit_fail_msg("mmap failed\n");
> ksft_test_result(range_is_not_populated(addr, SIZE),
> - "range initially not populated\n");
> + "read range initially not populated\n");
>
> ret = madvise(addr, SIZE, MADV_POPULATE_READ);
> ksft_test_result(!ret, "MADV_POPULATE_READ\n");
> ksft_test_result(range_is_populated(addr, SIZE),
> - "range is populated\n");
> + "read range is populated\n");
>
> munmap(addr, SIZE);
> }
> @@ -194,12 +194,12 @@ static void test_populate_write(void)
> if (addr == MAP_FAILED)
> ksft_exit_fail_msg("mmap failed\n");
> ksft_test_result(range_is_not_populated(addr, SIZE),
> - "range initially not populated\n");
> + "write range initially not populated\n");
>
> ret = madvise(addr, SIZE, MADV_POPULATE_WRITE);
> ksft_test_result(!ret, "MADV_POPULATE_WRITE\n");
> ksft_test_result(range_is_populated(addr, SIZE),
> - "range is populated\n");
> + "write range is populated\n");
>
> munmap(addr, SIZE);
> }
> @@ -247,19 +247,19 @@ static void test_softdirty(void)
> /* Clear any softdirty bits. */
> clear_softdirty();
> ksft_test_result(range_is_not_softdirty(addr, SIZE),
> - "range is not softdirty\n");
> + "cleared range is not softdirty\n");
>
> /* Populating READ should set softdirty. */
> ret = madvise(addr, SIZE, MADV_POPULATE_READ);
> - ksft_test_result(!ret, "MADV_POPULATE_READ\n");
> + ksft_test_result(!ret, "softdirty MADV_POPULATE_READ\n");
> ksft_test_result(range_is_not_softdirty(addr, SIZE),
> - "range is not softdirty\n");
> + "range is not softdirty after MADV_POPULATE_READ\n");
>
> /* Populating WRITE should set softdirty. */
> ret = madvise(addr, SIZE, MADV_POPULATE_WRITE);
> - ksft_test_result(!ret, "MADV_POPULATE_WRITE\n");
> + ksft_test_result(!ret, "softdirty MADV_POPULATE_WRITE\n");
> ksft_test_result(range_is_softdirty(addr, SIZE),
> - "range is softdirty\n");
> + "range is softdirty after MADV_POPULATE_WRITE \n");
>
> munmap(addr, SIZE);
> }
>
> ---
> base-commit: a5806cd506af5a7c19bcd596e4708b5c464bfd21
> change-id: 20250521-selftests-mm-madv-populate-dedupe-95faf16c3c8f
>
> Best regards,
> --
> Mark Brown <broonie@kernel.org>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] selftests/mm: Deduplicate test names in madv_populate
2025-05-22 16:29 [PATCH] selftests/mm: Deduplicate test names in madv_populate Mark Brown
2025-05-22 18:59 ` Liam R. Howlett
@ 2025-05-26 12:57 ` David Hildenbrand
1 sibling, 0 replies; 3+ messages in thread
From: David Hildenbrand @ 2025-05-26 12:57 UTC (permalink / raw)
To: Mark Brown, Andrew Morton, Shuah Khan
Cc: linux-mm, linux-kselftest, linux-kernel
On 22.05.25 18:29, Mark Brown wrote:
> The madv_populate selftest has some repetitive code for several different
> cases that it covers, included repeated test names used in ksft_test_result()
> reports. This causes problems for automation, the test name is used to both
> track the test between runs and distinguish between multiple tests within
> the same run. Fix this by tweaking the messages with duplication to be more
> specific about the contexts they're in.
>
> Signed-off-by: Mark Brown <broonie@kernel.org>
Acked-by: David Hildenbrand <david@redhat.com>
--
Cheers,
David / dhildenb
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-05-26 12:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-22 16:29 [PATCH] selftests/mm: Deduplicate test names in madv_populate Mark Brown
2025-05-22 18:59 ` Liam R. Howlett
2025-05-26 12:57 ` David Hildenbrand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox