From nobody Mon Apr 6 11:53:27 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 435073EF0C7 for ; Thu, 19 Mar 2026 17:39:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773941967; cv=none; b=BL3XJErmhlAYp2H1O3qHIU/ybhgtwsegySwpMV5hpZHX5JjIX6h1+qZXCvEUVwF85PNsg049WQRxqhDj2qDrSJ3CMpoOki3w0ZU4ArNCVEQLejXgONQ/7emzlhbnuGVnJYtFcWQrJadEf1wHwY7bcT23OfOKsLJ5LquN8rk6x0I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773941967; c=relaxed/simple; bh=wFAtlTmn43+vpFnlZmsivMZE1tzHU7BC53jPKGhv5C0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WMgUuXyye8uUTZNaDm8h+drC3pKh0isy3l19ANcKGvr/yVg0ox+d8VByuXwP6cRcIh0oJf3rjERUCCj9q9uMZNrxT8Zv3OcjGsEQXua5seGeJjeZmQegh7ZUur5C1MTvW8ZIDChYq6t5cvBWpDIOmAwAZ8DoloO0ULhGAtXZKPI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=aLalJSfs; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="aLalJSfs" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773941959; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y8AJoJFhemnk1DLT2xYvQamPJ/h63aubGqhq+ZDBiKQ=; b=aLalJSfsmaq/XAgufrfop47XPy6TGfAHnjZL+TUpl2wzWuhlEqa2WcpwTyfCZ4Bz2eZSLy QFLSAD3j3cpYpzN2wmgHes4/zyYRg2j57BklIiMUV1H5GQfudrPS45G3d+alOqIBK3mc+l WVRRbA/YmB5u9gU8ddvVix3DgoP3aFw= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-45-N4MyzdgGOh-xRtock0apmA-1; Thu, 19 Mar 2026 13:39:15 -0400 X-MC-Unique: N4MyzdgGOh-xRtock0apmA-1 X-Mimecast-MFC-AGG-ID: N4MyzdgGOh-xRtock0apmA_1773941953 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D731818005BB; Thu, 19 Mar 2026 17:39:12 +0000 (UTC) Received: from llong-thinkpadp16vgen1.westford.csb (unknown [10.22.80.194]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A7CE330001A1; Thu, 19 Mar 2026 17:39:09 +0000 (UTC) From: Waiman Long To: Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Andrew Morton , Tejun Heo , =?UTF-8?q?Michal=20Koutn=C3=BD?= , Shuah Khan , Mike Rapoport Cc: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, Sean Christopherson , James Houghton , Sebastian Chlad , Guopeng Zhang , Li Wang , Waiman Long Subject: [PATCH 7/7] selftests: memcg: Treat failure for zeroing sock in test_memcg_sock as XFAIL Date: Thu, 19 Mar 2026 13:37:52 -0400 Message-ID: <20260319173752.1472864-8-longman@redhat.com> In-Reply-To: <20260319173752.1472864-1-longman@redhat.com> References: <20260319173752.1472864-1-longman@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Content-Type: text/plain; charset="utf-8" Although there is supposed to be a periodic and asynchronous flush of stats every 2 seconds, the actual time lag between succesive runs can actually vary quite a bit. In fact, I have seen time lag of up to 10s of seconds in some cases. At the end of test_memcg_sock, it waits up to 3 seconds for the "sock" attribute of memory.stat to go back down to 0. Obviously it may occasionally fail especially when the kernel has large page size (e.g. 64k). Treat this failure as an expected failure (XFAIL) to distinguish it from the other failure cases. Signed-off-by: Waiman Long --- tools/testing/selftests/cgroup/test_memcontrol.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/cgroup/test_memcontrol.c b/tools/testi= ng/selftests/cgroup/test_memcontrol.c index 0ef09bafa68c..9206da51ac83 100644 --- a/tools/testing/selftests/cgroup/test_memcontrol.c +++ b/tools/testing/selftests/cgroup/test_memcontrol.c @@ -1486,12 +1486,20 @@ static int test_memcg_sock(const char *root) * Poll memory.stat for up to 3 seconds (~FLUSH_TIME plus some * scheduling slack) and require that the "sock " counter * eventually drops to zero. + * + * The actual run-to-run elapse time between consecutive run + * of asynchronous memcg rstat flush may varies quite a bit. + * So the 3 seconds wait time may not be enough for the "sock" + * counter to go down to 0. Treat it as a XFAIL instead of + * a FAIL. */ sock_post =3D cg_read_key_long_poll(memcg, "memory.stat", "sock ", 0, MEMCG_SOCKSTAT_WAIT_RETRIES, DEFAULT_WAIT_INTERVAL_US); - if (sock_post) + if (sock_post) { + ret =3D KSFT_XFAIL; goto cleanup; + } =20 ret =3D KSFT_PASS; =20 @@ -1753,6 +1761,9 @@ int main(int argc, char **argv) case KSFT_SKIP: ksft_test_result_skip("%s\n", tests[i].name); break; + case KSFT_XFAIL: + ksft_test_result_xfail("%s\n", tests[i].name); + break; default: ksft_test_result_fail("%s\n", tests[i].name); break; --=20 2.53.0