[LTP] memcg/functional: fix memcg_failcnt intermittent timeout by disabling swap

linuxtestproject.agent@gmail.com linuxtestproject.agent@gmail.com
Fri Jul 31 04:46:00 CEST 2026


Hi Xuewen,

On Fri, 31 Jul 2026, Xuewen Wang wrote:
> memcg/functional: fix memcg_failcnt intermittent timeout by disabling swap

> +	swapoff -a 2>/dev/null
> +
>  	start_memcg_process $2 -s ${MEMORY_TO_ALLOCATE}

The 2>/dev/null here hides errors from the very command that implements
the fix. If swapoff fails, or the command is not present, swap stays
enabled and the intermittent timeout this patch targets can recur, now
without any diagnostic to explain it.

memcg_limit_in_bytes.sh, cited as the model for this change, runs
swapoff -a and swapon -a without redirecting stderr. Would dropping the
redirect (at least on swapoff) be preferable, so a failure to disable
swap remains visible?

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