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

Waiman Long
2026-03-10T00:04:20Z

On 3/9/26 2:07 PM, Michal Koutný wrote:
> On Mon, Mar 09, 2026 at 12:02:05PM -0400, Waiman Long <longman@redhat.com> wrote:
>> On systems where IPv6 isn't enabled or not configured to support
>> SOCK_STREAM, the test_memcg_sock test always fails.
> I think IPv6 is not substantial for the check...
I mentioned it because the current code is using AF_INET6 family.
>
>> The purpose of the test_memcg_sock test is to verify that
>> memory.stat.sock and memory.current values are close.
> ... so this should work with IPv4 too.
Probably, I will try that out.
>
>> If the socket() call fails, there is no way we can test that. 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.
> Yes, the skip on (any) socket creation is also (independently) good.
>
>> @@ -1460,6 +1466,9 @@ static int test_memcg_sock(const char *root)
>> free(memcg);
>>
>> return ret;
>> +skip:
>> + ret = KSFT_SKIP;
>> + goto cleanup;
> Maybe make this analogous with other cases where there is no specific skip-label but
>
> if (err == EAFNOSUPPORT) {
> ret = KSFT_SKIP;
> goto cleanup;
> }

Yes, that will work too. Will make the update in the next version.

Cheers,
Longman