[LTP] syscalls/madvise: Make use of .min_swap_avail and .min_mem_avail
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Tue Jun 9 17:59:44 CEST 2026
Hi Cyril,
On Tue, 9 Jun 2026 17:23:05 +0200, Cyril Hrubis wrote:
> syscalls/madvise: Make use of .min_swap_avail and .min_mem_avail
> - SAFE_FILE_LINES_SCANF("/proc/meminfo", "SwapTotal: %ld", &swap_total);
> - if (swap_total <= 0)
> - tst_brk(TCONF, "MADV_FREE does not work without swap");
> [...]
> + .min_swap_avail = SWAP_LIMIT / TST_MB,
The commit message describes this as moving the existing runtime
checks into the tst_test structure, but the madvise09 change is
not an equivalent transformation.
The old code checked SwapTotal > 0, i.e. whether any swap is
configured at all. The new .min_swap_avail check uses SwapFree
and requires at least SWAP_LIMIT / TST_MB = 16 MB of available
swap. This tightens the requirement in two ways: it looks at
free swap rather than total, and it raises the threshold from
"any swap" to 16 MB.
If this is intentional (which seems reasonable since the test
does need swap space), could the commit message mention the
semantic change for madvise09?
Verdict: Needs revision
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
More information about the ltp
mailing list