From 8930760d468d94b47b013bd5f0256ff2e1776b78 Mon Sep 17 00:00:00 2001 From: Aveline Noir Date: Wed, 30 Sep 2026 23:00:27 -0700 Subject: [PATCH] selftests/mm: mrelease_test: fix retry limit 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. Link: https://lore.kernel.org/CANOyQmFzsssM_BXHUDrV+UuVD5SZMBmSkg3UQnmw9Ns1PV7GCQ@mail.gmail.com Fixes: 33776141b812 ("selftests: vm: add process_mrelease tests") Signed-off-by: Aveline Noir Signed-off-by: Andrew Morton Acked-by: David Hildenbrand (Arm) Acked-by: Lorenzo Stoakes (ARM) Reviewed-by: SJ Park Assisted-by: LLM Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Liam R. Howlett Cc: Vlastimil Babka Cc: Mike Rapoport Cc: Michal Hocko Cc: Christian Brauner Cc: Muhammad Usama Anjum --- 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));