Re: [PATCH v2] selftest: memcg: Skp memcg_sock test if address family not supported

From: Michal Koutný

Date: Wed Mar 11 2026 - 06:31:56 EST


On Tue, Mar 10, 2026 at 10:39:35AM -0400, Waiman Long <longman@xxxxxxxxxx> wrote:
> The test_memcg_sock test in memcontrol.c sets up an IPv6 socket and
> send data over it to consume memory and verify that memory.stat.sock
> and memory.current values are close.
>
> On systems where IPv6 isn't enabled or not configured to support
> SOCK_STREAM, the test_memcg_sock test always fails. When the socket()
> call fails, there is no way we can test the memory consumption and
> verify the above claim. I believe it is better to just skip the test
> in this case instead of reporting a test failure hinting that there
> may be something wrong with the memcg code.
>
> Fixes: 5f8f019380b8 ("selftests: cgroup/memcontrol: add basic test for socket accounting")
> Signed-off-by: Waiman Long <longman@xxxxxxxxxx>
>
> [v2] Update and commit log & adjust the skip code as suggested by Michael.
>
> ---
> tools/testing/selftests/cgroup/test_memcontrol.c | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)

Thanks,
Acked-by: Michal Koutný <mkoutny@xxxxxxxx>

Attachment: signature.asc
Description: PGP signature