From: Daniel Gomez Date: Wed, 18 Jun 2025 13:00:12 +0000 (+0200) Subject: generic/551: prevent OOM when running on tmpfs with low memory X-Git-Tag: v2025.06.22~4 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=e17714ed95441bf2a2ee80c6e0f8af3841ffb255;p=xfstests-dev.git generic/551: prevent OOM when running on tmpfs with low memory 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 --- 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))