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

[email protected] Wed, 5 Aug 2026 07:40:04 +0000
Newsgroups gmane.linux.ltp
Message-ID <[email protected]>
Hi Xuewen,

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

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

Could the test save and restore the initially active swap areas instead?
`swapon -a` does not restore the original state: an active area absent from
fstab, such as zram, remains disabled, while an fstab area that was initially
disabled may be enabled. The cleanup also runs if setup exits before
`swapoff -a`, so that path can enable swap without the test disabling it.

> +	swapoff -a

Could `swapon` and `swapoff` be declared in `TST_NEEDS_CMDS`, and could this
invocation abort on failure? A bare command failure is ignored by the shell
library, so a missing command or a failure to move swapped pages back to RAM
allows the allocation to proceed with swap still active and preserves the
timeout this patch is intended to fix. Failures while restoring swap should
also be reported.

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