From: Li Wang <li.wang@linux.dev>
To: Xuewen Wang <wangxuewen@kylinos.cn>
Cc: ltp@lists.linux.it, liwang@hygon.cn
Subject: Re: [LTP] [PATCH v2] memcg/functional: fix memcg_failcnt intermittent timeout by disabling swap
Date: Wed, 5 Aug 2026 15:34:49 +0800 [thread overview]
Message-ID: <anLnmVKGARAsrV6O@linux.dev> (raw)
In-Reply-To: <20260805064053.916492-1-wangxuewen@kylinos.cn>
Hi Xuewen,
Xuewen Wang wrote:
> memcg_failcnt.sh tests the memory.failcnt counter by allocating
> reclaimable memory (mmap-anon/mmap-file/shm) beyond a tiny cgroup
> limit (1 page). It relies on the process being OOM-killed so that
> signal_memcg_process()'s wait loop exits.
>
> With swap enabled the kernel usually still OOM-kills the process,
> but on arm64 reclaim (swap out) sometimes succeeds instead:
> usage_in_bytes stays at the limit and the process keeps running,
> so the wait loop times out (TBROK) intermittently.
>
> Example failure on arm64 (kernel 6.6):
> memcg_failcnt 2 TBROK: timed out on memory.usage_in_bytes 4096 0 8192
>
> Disable swap around the allocation and re-enable it afterwards,
> mirroring what memcg_limit_in_bytes.sh already does for the same
> reclaimable memory types.
This fix make sense, but I'd rather go with a tidy way:
...
TST_SETUP=do_setup
TST_CLEANUP=do_cleanup
do_setup()
{
memcg_setup
swapoff -a
}
do_cleanup()
{
swapon -a
memcg_cleanup
}
...
My Red Hat email address is no longer used. Please CC my new
address for future versions:
li.wang@linux.dev
or:
liwang@hygon.cn
--
Regards,
Li Wang
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2026-08-05 7:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-05 6:40 [LTP] [PATCH v2] memcg/functional: fix memcg_failcnt intermittent timeout by disabling swap Xuewen Wang
2026-08-05 7:34 ` Li Wang [this message]
2026-08-07 2:00 ` Xuewen Wang
2026-08-05 7:40 ` [LTP] " linuxtestproject.agent
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=anLnmVKGARAsrV6O@linux.dev \
--to=li.wang@linux.dev \
--cc=liwang@hygon.cn \
--cc=ltp@lists.linux.it \
--cc=wangxuewen@kylinos.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox