]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftest: memcg: skip memcg_sock test if address family not supported
authorWaiman Long <longman@redhat.com>
Wed, 11 Mar 2026 20:05:26 +0000 (16:05 -0400)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 5 Apr 2026 20:53:27 +0000 (13:53 -0700)
commit2d028f3e4bbbfd448928a8d3d2814b0b04c214f4
tree3164ffb03479b84d46f3a974283443b53a20cc2f
parentf08f610ea00b75d6174cd34950a8338d51a0729f
selftest: memcg: skip memcg_sock test if address family not supported

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.

Link: https://lkml.kernel.org/r/20260311200526.885899-1-longman@redhat.com
Fixes: 5f8f019380b8 ("selftests: cgroup/memcontrol: add basic test for socket accounting")
Signed-off-by: Waiman Long <longman@redhat.com>
Acked-by: Michal Koutný <mkoutny@suse.com>
Acked-by: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Michal Koutný <mkoutny@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/selftests/cgroup/test_memcontrol.c