From: Petr Vorel <pvorel@suse.cz>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] syscalls/madvise06: Fix sporadic not enough RAM TCONFs
Date: Wed, 27 May 2026 13:29:11 +0200 [thread overview]
Message-ID: <20260527112911.GA194670@pevik> (raw)
In-Reply-To: <20260527103756.448843-1-chrubis@suse.cz>
Hi Cyril,
> On systems with <= 2GB RAM the test produced sporadic TCONFs. That is
> because even if the test setup does sync() and drops caches the system
> starts fauting in pages immediatelly after caches were dropped. It may
> easily happen that system may fault in a few hundred of MBs of memory
> betwen the write to drop_caches and the time sysinfo() syscall returns.
> The correct fix is to use the MemAvailable metric from /proc/meminfo
> that includes both free memory and caches and is more realistic estimate
> of how much memory can be consumed by a test. We even have helper
> functions in the test library so we simply make use of them.
Thanks for an investigation!
Reviewed-by: Petr Vorel <pvorel@suse.cz>
...
> - sysinfo(&sys_buf_start);
> - if (sys_buf_start.freeram < 2 * CHUNK_SZ) {
> - tst_brk(TCONF, "System RAM is too small (%li bytes needed)",
> - 2 * CHUNK_SZ);
> + long long avail_mem = tst_available_mem();
> + long long avail_swap = tst_available_swap();
> + long long chunk_kb = 2 * CHUNK_SZ / 1024;
> +
> + if (avail_mem < chunk_kb) {
> + tst_brk(TCONF, "System RAM is too small %llikB (%llikB needed)",
> + avail_mem, chunk_kb);
nit: I'd print also the current (not big enough) values (I know that the old code).
Reviewed-by: Petr Vorel <pvorel@suse.cz>
> }
> - if (sys_buf_start.freeswap < 2 * CHUNK_SZ) {
> - tst_brk(TCONF, "System swap is too small (%li bytes needed)",
> - 2 * CHUNK_SZ);
> +
> + if (avail_swap < chunk_kb) {
> + tst_brk(TCONF, "System swap is too small %llikB (%llikB needed)",
> + avail_swap, chunk_kb);
> }
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2026-05-27 11:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-27 10:37 [LTP] [PATCH] syscalls/madvise06: Fix sporadic not enough RAM TCONFs Cyril Hrubis
2026-05-27 11:22 ` Li Wang
2026-05-27 11:29 ` Petr Vorel [this message]
2026-05-27 12:13 ` Cyril Hrubis
2026-05-27 12:17 ` Petr Vorel
2026-05-27 13:06 ` [LTP] " linuxtestproject.agent
2026-05-27 13:24 ` Cyril Hrubis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260527112911.GA194670@pevik \
--to=pvorel@suse.cz \
--cc=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.