[LTP] madvise09: Scale cgroup memory/swap limits dynamically with page size

linuxtestproject.agent@gmail.com linuxtestproject.agent@gmail.com
Thu Jul 23 10:32:01 CEST 2026


Hi Wei,

On 2026-07-23, Wei Gao wrote:
> madvise09: Scale cgroup memory/swap limits dynamically with page size

> * o Set memory limits
> *   - memory.max = 8MB
> *   - memory.swap.max = 16MB

Now that mem_limit and swap_limit are derived from page_size at
runtime, are these values still accurate for the description block?
On a 64KB page system mem_limit becomes 128MB and swap_limit 256MB,
but the doc comment still states the old fixed 8MB/16MB.

> +	if (tst_available_swap() < swap_limit / 1024) {
> +		tst_brk(TCONF, "System needs at least %ldMB free swap to run this test",
> +			swap_limit / TST_MB);
> +	}

This check runs unconditionally in setup(), but swap_limit is only
ever written to memory.swap.max when swap_accounting_enabled is true;
otherwise child() takes the "running without SWAP_LIMIT" path and
never enforces it. Could this needlessly skip the test (TCONF) on
systems with swap accounting disabled but with less free swap than
swap_limit, even though swap_limit isn't used there?

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