mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] selftests/mm: mrelease_test: fix retry limit
@ 2026-10-01  6:00 Aveline Noir
  2026-10-01  9:47 ` David Hildenbrand (Arm)
  0 siblings, 1 reply; 3+ messages in thread
From: Aveline Noir @ 2026-10-01  6:00 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand, Shuah Khan
  Cc: Suren Baghdasaryan, Lorenzo Stoakes, Liam R. Howlett,
	Vlastimil Babka, Mike Rapoport, Michal Hocko, Christian Brauner,
	Muhammad Usama Anjum, linux-mm, linux-kselftest, linux-kernel

mrelease_test doubles the child allocation when process_mrelease()
returns ESRCH.

When size is already MAX_SIZE_MB, the current <= check still allows
another retry, causing the allocation to grow from 1024 MB to 2048 MB.

Use < instead of <= so the largest allocation attempted remains
MAX_SIZE_MB.

LLM used in discovering bug. Changes were made and reviewed manually.

Fixes: 33776141b812 ("selftests: vm: add process_mrelease tests")
Assisted-by: LLM
Signed-off-by: Aveline Noir <jm5905938@gmail.com>
---
 tools/testing/selftests/mm/mrelease_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/mm/mrelease_test.c
b/tools/testing/selftests/mm/mrelease_test.c
index 64e8d00ae944..a5124c9e9f43 100644
--- a/tools/testing/selftests/mm/mrelease_test.c
+++ b/tools/testing/selftests/mm/mrelease_test.c
@@ -157,7 +157,7 @@ int main(void)
 		 * Retry until we succeed or reach MAX_SIZE_MB.
 		 */
 		if (errno == ESRCH) {
-			retry = (size <= MAX_SIZE_MB);
+			retry = (size < MAX_SIZE_MB);
 		} else {
 			waitpid(pid, NULL, 0);
 			ksft_exit_fail_msg("process_mrelease: %s\n", strerror(errno));
-- 
2.55.0

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

end of thread, other threads:[~2026-10-01 11:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-01  6:00 [PATCH] selftests/mm: mrelease_test: fix retry limit Aveline Noir
2026-10-01  9:47 ` David Hildenbrand (Arm)
2026-10-01 11:06   ` Lorenzo Stoakes (ARM)

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

all inboxes | Powered by JetHome®