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

[email protected] Fri, 31 Jul 2026 02:46:00 +0000
Newsgroups it.linux.lists.ltp
Message-ID <[email protected]>
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

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp