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

Li Wang <[email protected]>
Newsgroups gmane.linux.ltp
Message-ID <[email protected]>
[email protected] wrote:

> 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.

Fair point that ignoring the return status defeats the purpose. But I'd
rather not TBROK on a swapoff failure, that's an environment limitation,
not a test failure. Especially swapoff here is an enhancement but not
a hard requirement for this test.

> 
> > +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.

That is a bit over-engineering.

If an inactive fstab entry gets activated by swapon -a, that arguably
points to a misconfigured test host rather than something this test
should work around.


-- 
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.