From e17714ed95441bf2a2ee80c6e0f8af3841ffb255 Mon Sep 17 00:00:00 2001 From: Daniel Gomez Date: Wed, 18 Jun 2025 15:00:12 +0200 Subject: [PATCH] generic/551: prevent OOM when running on tmpfs with low memory MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Running generic/551 on a tmpfs filesystem with less than 10 GB (ish) of RAM can lead to the system running out of memory, triggering the kernel's OOM killer and terminating the aio-dio-write-v process. Fix generic/551 by substracting the amount of available memory allocated for the tmpfs scratch device to the total available free memory. Reported-by: Chuck Lever Signed-off-by: Daniel Gomez Reviewed-by: Zorro Lang Signed-off-by: Zorro Lang --- tests/generic/551 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/generic/551 b/tests/generic/551 index 4a7f0a63..267c57ec 100755 --- a/tests/generic/551 +++ b/tests/generic/551 @@ -39,6 +39,10 @@ do_test() local total_size=0 local avail_mem=`_available_memory_bytes` + # To avoid OOM on tmpfs, subtract the amount of available memory + # allocated for the tmpfs + [ "$FSTYP" = "tmpfs" ] && avail_mem=$((avail_mem - free_size_k * 1024)) + # the number of AIO write operation num_oper=$((RANDOM % 64 + 1)) -- 2.47.3