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

linuxtestproject.agent@gmail.com linuxtestproject.agent@gmail.com
Fri Aug 7 04:51:50 CEST 2026


Hi Xuewen,

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

> +do_setup()
> +{
> +	memcg_setup
> +	swapoff -a
> +}

Could this use ROD so a failed swapoff aborts the test? swapoff can fail
when there is not enough memory to page the swap contents back in.
_tst_run_iterations() ignores the setup function's return status, so the
test proceeds with swap enabled and the original intermittent timeout
remains.

> +do_cleanup()
> +{
> +	swapon -a
> +	memcg_cleanup
> +}

Could cleanup restore only swap areas that were active before setup, and
only if swapoff was attempted? TST_DO_CLEANUP is set before do_setup(), so
a TCONF from memcg_setup() reaches this function before swapoff. swapon -a
can then activate previously inactive fstab entries. Conversely, dynamically
managed swap areas absent from fstab are disabled by swapoff -a but are not
restored by swapon -a.

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