[LTP] madvise09: Reset cgroup limits before retrying test
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Mon Jul 13 04:44:04 CEST 2026
Hi Wake,
On Mon Jul 13 01:25:45 2026, Wake Liu wrote:
> madvise09: Reset cgroup limits before retrying test
> + if (SAFE_CG_HAS(tst_cg, "memory.max"))
> + SAFE_CG_PRINT(tst_cg, "memory.max", "max");
The test requires `.needs_cgroup_ctrls = { "memory", NULL }`, so
memory.max is guaranteed to exist when the memory controller is
available. The SAFE_CG_HAS guard is unnecessary here and creates an
inconsistency with the unconditional write to the same file later:
SAFE_CG_PRINTF(tst_cg, "memory.max", "%d", MEM_LIMIT);
Can the guard be dropped to match the style used for the later write?
> + if (swap_accounting_enabled && SAFE_CG_HAS(tst_cg, "memory.swap.max"))
> + SAFE_CG_PRINT(tst_cg, "memory.swap.max", "max");
swap_accounting_enabled is already set in setup() based on
SAFE_CG_HAS(tst_cg, "memory.swap.max"), so the second SAFE_CG_HAS
call is redundant. The later write is correctly guarded with just
swap_accounting_enabled:
if (swap_accounting_enabled) {
SAFE_CG_PRINTF(tst_cg, "memory.swap.max", "%d", SWAP_LIMIT);
Can this be simplified to match?
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