From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (unknown [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id A43F58045D for ; Mon, 19 Oct 2026 19:48:58 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 69JJlg4p025921; Mon, 19 Oct 2026 22:47:43 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69JJlg4p025921 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="C32RJwD5" Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 69JJlc1E025904 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Mon, 19 Oct 2026 22:47:38 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69JJlc1E025904 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-48e00f3929bso22155f8f.0 for ; Mon, 19 Oct 2026 12:47:38 -0700 (PDT) X-Gm-Message-State: AFq9FYIYqspRsUUSbtKetX0LcJE7RBRidEBWKILb7pHQH8ofhVnyP7MG mvvFaD1lrWVkFXl1z+ijMCCm3rlrKE9jUrKpXXkFt/ZSpGQwActNuxAeeexIMoUt0UtUE4It9Q2 ead4iMQ5/RtpUvspRMo2hsmgO2Fs/xqmbH3H6wngJjXOpKCPO0TNiwQ== X-Gm-Gg: AYBFou07Q0BXErYtz18bpsfThPJCiV3rjdS2/3e77uPmoT7yQ50VMsbm11OjFyITOFQ RH1/5tGPXtS9ZdsNdDRbFnmdH0kRQM7eXulE2oF2TfeFEVdaDtET2cLUCnsS4ZAI3rA7NexTRBH qdmhxubKPVoUCATq3CGljG33F7Qv63O+Db/9phhJ6gY+TQqzE91h3V0BXBvB4GTgAMsgdBQg1x9 yj7meW0moEBdyVu62N3ZKzj5R1eADaBx3zSAfaKRnoEyRt2s/aelft1c0f7RZKC7HMv21WYb+m9 WFym1k3BMBX1xd142a4qV5VzSdC5urfykAoh761QVwUmvtPlJlpVjBgIaY+AswBivl4FOBQwPtc KvOLri4quzUgRjAGm8w== X-Received: by 2002:a5d:5d86:0:b0:48e:d40:a87c with SMTP id ffacd0b85a97d-48e1e7cc307mr280521f8f.16.1792439258121; Mon, 19 Oct 2026 12:47:38 -0700 (PDT) X-Received: by 2002:a5d:5d86:0:b0:48e:d40:a87c with SMTP id ffacd0b85a97d-48e1e7cc307mr280478f8f.16.1792439257584; Mon, 19 Oct 2026 12:47:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1792439257; cv=none; d=google.com; s=arc-20260327; b=Er7M0Q1Z2HQIweNsNhVHe2/KhGzeTbWiF9wNAZVER7Tc6blnZv6AxLGvUVBoDEygfV 6XUlidVahty2NVMxyYmnrD75MwsEiYoH2fLLL70tULXchJYeRr8YW8MqsBTDXvMPJN7H IRh5XqB78xe6hDjiH7kdA5aD/RqB4AyqerSV7JoCDtv7X3p6F3n2w2Itz+5rUUowhhcw YW7sQfaBwaDN1AIvCUiLRBJ2E2dUIhtez6wXd+mFGyrdzWB/e4v0P3P7duuq+2oneJ1Y vIoKYWVOoELsS/XsQT8e8v7sF/TrykL+ztD7bqSSNriaVLQNQJJKAr0vdaY8s4qkGvoe V25g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=B81ct1PT1pz9lGtDLaevwY03tcjy/e7vXHri1Q3t+CE=; fh=u94vpSnbACPnIkIPa1XdGqhjZt/kxdbqUA9AiFps/bg=; b=afG8ZBOizamwsldp0BM9PqMh282XgYx9GW1kGgEEf7+0onLa+/CM8+1uL306ye02z9 M6P4JO1a3iS/X5+58XCNK4BmvR2enEq7SlGE8bDoqwJBNClbwsbB6nxWYitBXHXB3Tj8 Y8SnmWqY+escx2i8TGeWY5IehMJ6+cMGCYsgPNrSWweOqs477EWWyl/3wtaBO5PxYmJ3 UL9RuAQC5brO2SBQNCXpEF5xhqYxnExmAtyJb+uZVhxchfYnytlSBb42cddEaGasDCfp GWv54ZeGK1SxWpI5LsmR0ohxMim9Bfk32NFfgJflvB2zgPwq1JmIZVYx9itoIuySgCSu NV1Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=C32RJwD5; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id ffacd0b85a97d-48e1d85f798si727736f8f.498.2026.10.19.12.47.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Oct 2026 12:47:37 -0700 (PDT) Received-SPF: pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=C32RJwD5; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=Message-Id:Content-Type:MIME-Version:Subject:Date :From; bh=B81ct1PT1pz9lGtDLaevwY03tcjy/e7vXHri1Q3t+CE=; b=C32RJwD59kuiFd2exvo 1zSGZaqm4pCZjX7Ck/S18qZ+Le3KOeMm0U/kjKuoWb1GPGB+DwYFAmVeH47K/5TD2+sL5EhKq00sA TeJNzbFd6Is732Up69WZon1VaWHT8xboVDnSXyy4OquxZkh0LuhdXpd3ewX7Fcom7ovdttZcJZr13 D1pcd3kiI2eA2cjoHNlvEYfcXL20QvRcFGBWZZlQhLX5K1waQ4y3fCJs1JXlbxsy6imdXNS3YZVCw UCFrFx4UCJGEKZBAdEnRpvy14HL0oPIGd7SftOeeRJdmiukpkSNEBDGOEFJ2P9EzbdarXhbOKC92l JCThi2Xai4f/ufA==; Received: from ch-demo-asa.virtuozzo.com ([130.117.225.8] helo=f0.sw.ru) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1xItH2-009fSm-16; Mon, 19 Oct 2026 21:47:28 +0200 From: Konstantin Khorenko Date: Mon, 19 Oct 2026 21:47:33 +0200 MIME-Version: 1.0 Message-Id: <20261019-b4-prep-khorenko-vstor-149854-selftests-test_memcg_sock-v1-1-efbfa45dc967@virtuozzo.com> References: <20261019-b4-prep-khorenko-vstor-149854-selftests-test_memcg_sock-v1-0-efbfa45dc967@virtuozzo.com> In-Reply-To: <20261019-b4-prep-khorenko-vstor-149854-selftests-test_memcg_sock-v1-0-efbfa45dc967@virtuozzo.com> To: devel@openvz.org, Konstantin Khorenko X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2349; i=khorenko@virtuozzo.com; h=from:subject:message-id; bh=ibkjpi0q01XTY9FLWtxn4cAeqwsvA/MtK0yTYhfNGqY=; b=owEBbQKS/ZANAwAKAVGWCkf5YVwqAcsmYgBq1nPYNYUUfe+W9HqT9wtbkp/UgJNy9+U0KgLcs TP8xu3u/XSJAjMEAAEKAB0WIQRWD23IPcXT0GO9CCxRlgpH+WFcKgUCatZz2AAKCRBRlgpH+WFc KmJBEADAgulOM4TQyvqA/pjj7rEtuOhGQHuRfgwI38/m6Skzg101F4mwQa5Gtm8/GdWYZ/0fBPI /ojlh4EVI11qvOLAe/sNvPU33yNAYMSBPg90ejjdMaWL8mE+PW9BHpmP3UArdMN/M6ZqeP3ftIm ohflfoDo1nfrFJ+PTCOKAYqlFykPC2Zvo1xAaKLr0GqjbjM8JQiop5N/hzqUqEKztBYu529q4Qk FOMU0kjsnx0G16g5x7YK/okigIOXGmXksFFL4fC1VxLlB/kPy6ezxsRXLJAe6PJW5xhTupKUPOX kc5DMOrTwzoDdI2mTpdQ7gt7X48+ggfK7ZcZkw4l9dh0cgdxUy1V0Q269B5dWDRC4mY4Ipskkf+ S2mxxDDPNq9gG12k5tLl3BPXIapGQMeJyK68eJ1Wjuc5mV2mspPcHFUtLIucTIr7kvveYRVdlaJ RjtR7oql4gH/X/MZWb6GPlF+lHNYKt9XrEF477vM6H6FgZbrzFk7DPkQU5/zOjpSFqZycV8Saaq 4El5kdxSQpJ7UQ6CARkuL/6i327i9D+gDcG4NvoRGGxwqDhl1d0EZJq4ouooqW1P5pnGTpEY4BK 6nBoAn9BD1O4oBNslC2ddqov/3bVBRKPtJfPAJPqIBfW5+FMR5Kr4y8vJ9UF0Bes40xz+hJVCUD 9io8XPsKr7YYe1Q== X-Developer-Key: i=khorenko@virtuozzo.com; a=openpgp; fpr=560F6DC83DC5D3D063BD082C51960A47F9615C2A X-OZ-Fwd: true Subject: [Devel] [PATCH hci-8.1 1/2] ms/selftests: cgroup: skip test_memcg_sock under cgroup.memory=nosocket X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org With cgroup.memory=nosocket the memory controller does not charge socket memory, so the "sock " entry of memory.stat stays 0 and memory.current moves only by the kernel objects accept() allocates. tcp_client() then passes on 0 == 0 without having checked any accounting, or fails if those objects took a fresh charge batch. Look for nosocket among the cgroup.memory= options on the kernel command line and skip the test there. Assisted-by: LLM Signed-off-by: Konstantin Khorenko Signed-off-by: Tejun Heo (cherry picked from commit 216a983640bce942e25c62e9d2f901dfba888cca) Conflict: cgroup_util.h here still calls the buffer size PAGE_SIZE, the rename to BUF_SIZE in 6e9f5c2eecd1 ("selftests/cgroup: rename PAGE_SIZE to BUF_SIZE in cgroup_util") is not in the tree, so memcg_sockets_disabled() sizes its buffer with PAGE_SIZE. The value is the same. https://virtuozzo.atlassian.net/browse/VSTOR-149854 Feature: fix selftests Signed-off-by: Konstantin Khorenko --- tools/testing/selftests/cgroup/test_memcontrol.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tools/testing/selftests/cgroup/test_memcontrol.c b/tools/testing/selftests/cgroup/test_memcontrol.c index 7519aeff4dbd1..003c865d8db93 100644 --- a/tools/testing/selftests/cgroup/test_memcontrol.c +++ b/tools/testing/selftests/cgroup/test_memcontrol.c @@ -1356,6 +1356,24 @@ static int tcp_client(const char *cgroup, unsigned short port) return ret; } +static bool memcg_sockets_disabled(void) +{ + char buf[4 * PAGE_SIZE], *opt; + + if (read_text("/proc/cmdline", buf, sizeof(buf)) <= 0) + return false; + + for (opt = strstr(buf, "cgroup.memory="); opt; + opt = strstr(opt + 1, "cgroup.memory=")) { + char *end = strchrnul(opt, ' '); + char *ns = strstr(opt, "nosocket"); + + if (ns && ns < end) + return true; + } + return false; +} + /* * This test checks socket memory accounting. * The test forks a TCP server listens on a random port between 1000 @@ -1370,6 +1388,9 @@ static int test_memcg_sock(const char *root) unsigned short port; char *memcg; + if (memcg_sockets_disabled()) + return KSFT_SKIP; + memcg = cg_name(root, "memcg_test"); if (!memcg) goto cleanup; -- 2.43.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel