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

Li Wang <[email protected]>
Newsgroups gmane.linux.ltp
Message-ID <[email protected]>
Hi Xuewen, Andrea,

On Fri, Aug 07, 2026 at 05:34:49AM +0000, Andrea Cervesato wrote:
> Hi Li,
> 
> > 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.
> 
> I agree.
> 
> > 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.
> 
> And also here. Unfortunately we don't have enough data for shell tests,
> so AI agent is not really working well in there..
> 
> Honestly I don't know how to fix this but adding more examples which
> we don't have..

No worries, AI agent being too strict in reviewing is not a bad thing.
It inspires me to think about something maybe in a different way.

Like this patch, I am now thinking if we can just limit it only
inside the cgroup:

--- a/testcases/kernel/controllers/memcg/functional/memcg_failcnt.sh
+++ b/testcases/kernel/controllers/memcg/functional/memcg_failcnt.sh
@@ -17,18 +17,17 @@ TST_CLEANUP=do_cleanup
 do_setup()
 {
        memcg_setup
-       swapoff -a
 }

 do_cleanup()
 {
-       swapon -a
        memcg_cleanup
 }

 do_test()
 {
        ROD echo $MEMORY_LIMIT \> memory.limit_in_bytes
+       ROD echo 0 \> memory.swappiness

        start_memcg_process $2 -s ${MEMORY_TO_ALLOCATE}
        ROD echo $MEMCG_PROCESS_PID \> tasks

@Xuewen, can you try this patch and see if it can solve your problem?

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