Skip to content

Commit cfc6951

Browse files
broonieakpm00
authored andcommitted
selftests/mm: deduplicate test names in madv_populate
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. Link: https://lkml.kernel.org/r/20250522-selftests-mm-madv-populate-dedupe-v1-1-fd1dedd79b4b@kernel.org Signed-off-by: Mark Brown <[email protected]> Reviewed-by: Liam R. Howlett <[email protected]> Acked-by: David Hildenbrand <[email protected]> Cc: Shuah Khan <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 3bf6717 commit cfc6951

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tools/testing/selftests/mm/madv_populate.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,12 @@ static void test_populate_read(void)
172172
if (addr == MAP_FAILED)
173173
ksft_exit_fail_msg("mmap failed\n");
174174
ksft_test_result(range_is_not_populated(addr, SIZE),
175-
"range initially not populated\n");
175+
"read range initially not populated\n");
176176

177177
ret = madvise(addr, SIZE, MADV_POPULATE_READ);
178178
ksft_test_result(!ret, "MADV_POPULATE_READ\n");
179179
ksft_test_result(range_is_populated(addr, SIZE),
180-
"range is populated\n");
180+
"read range is populated\n");
181181

182182
munmap(addr, SIZE);
183183
}
@@ -194,12 +194,12 @@ static void test_populate_write(void)
194194
if (addr == MAP_FAILED)
195195
ksft_exit_fail_msg("mmap failed\n");
196196
ksft_test_result(range_is_not_populated(addr, SIZE),
197-
"range initially not populated\n");
197+
"write range initially not populated\n");
198198

199199
ret = madvise(addr, SIZE, MADV_POPULATE_WRITE);
200200
ksft_test_result(!ret, "MADV_POPULATE_WRITE\n");
201201
ksft_test_result(range_is_populated(addr, SIZE),
202-
"range is populated\n");
202+
"write range is populated\n");
203203

204204
munmap(addr, SIZE);
205205
}
@@ -247,19 +247,19 @@ static void test_softdirty(void)
247247
/* Clear any softdirty bits. */
248248
clear_softdirty();
249249
ksft_test_result(range_is_not_softdirty(addr, SIZE),
250-
"range is not softdirty\n");
250+
"cleared range is not softdirty\n");
251251

252252
/* Populating READ should set softdirty. */
253253
ret = madvise(addr, SIZE, MADV_POPULATE_READ);
254-
ksft_test_result(!ret, "MADV_POPULATE_READ\n");
254+
ksft_test_result(!ret, "softdirty MADV_POPULATE_READ\n");
255255
ksft_test_result(range_is_not_softdirty(addr, SIZE),
256-
"range is not softdirty\n");
256+
"range is not softdirty after MADV_POPULATE_READ\n");
257257

258258
/* Populating WRITE should set softdirty. */
259259
ret = madvise(addr, SIZE, MADV_POPULATE_WRITE);
260-
ksft_test_result(!ret, "MADV_POPULATE_WRITE\n");
260+
ksft_test_result(!ret, "softdirty MADV_POPULATE_WRITE\n");
261261
ksft_test_result(range_is_softdirty(addr, SIZE),
262-
"range is softdirty\n");
262+
"range is softdirty after MADV_POPULATE_WRITE \n");
263263

264264
munmap(addr, SIZE);
265265
}

0 commit comments

Comments
 (0)