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 5352A8045D for ; Mon, 19 Oct 2026 19:48:56 +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 69JJldVX025912; Mon, 19 Oct 2026 22:47:39 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69JJldVX025912 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="CEoFbVvK" Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 69JJlcBd025902 (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 69JJlcBd025902 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-48b02d63407so1823338f8f.0 for ; Mon, 19 Oct 2026 12:47:38 -0700 (PDT) X-Gm-Message-State: AFq9FYJDHC1UDpa1ani8j2GxCAXNfI8SjvZ7hsANsvdWeERVdWymGuEZ HkuNGPT+ZwG1VvqGFapknXBFERAmKjpgTzhAIC46l9/R6Ugn72HjPfG/5wN2FYhjloNxrJo4tWQ 8TE5tSZXPH3UAoPv+1GSLTvkXzlddk2PlEf+CXYUgv7j7zjf46WmzpA== X-Gm-Gg: AYBFou30a7O+MskEm/3jY1P+4lBUQ4PZO4b+Lj2aYHmi4r+HAy/cqfUkh4pnaVH0qa2 txfKorEVV7sdxz4bxFaqiNvbzRPbJ+ee4ttwVxGLx7g1t/hHs8uEUuukXzlSLDyZyak0B7ZfhLq 2SnqP+RuAh7nyqWYaDMcp6tS3FA9AxpNknd4sqwUCyi8q0s4iv0qaRGAURwofA6EbyQqK5WXLPI H504pnxPaTl87GO6OGCgDHniKgCU0VCv4muvuT7kZWzeJdZHB81rLZjWn9ehpM6pXFEHmKyXcRe Q09z7zeaWIXMEvMJBYhradK9/VyO21JMH+Szd3ou0XE9kH5Ninvo6PGW3jj19ilxJE12tS4xS9B aDp1IckPVEYHGd/q0Mg== X-Received: by 2002:a05:6000:388:b0:48d:ed96:e995 with SMTP id ffacd0b85a97d-48e07fa1f6cmr17930009f8f.28.1792439258137; Mon, 19 Oct 2026 12:47:38 -0700 (PDT) X-Received: by 2002:a05:6000:388:b0:48d:ed96:e995 with SMTP id ffacd0b85a97d-48e07fa1f6cmr17929946f8f.28.1792439257582; 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=D357uXs4exzv65uMEtHele3plFPL07XuPLkLvFC+a5R7B6JmBFwc7n3jyCzopoI+VM n5R976ez/KDxTAfY+R0nXKjF2aw6FZ5sOQNezsKjPuc5KvnZIrZ6XY+557O9thmRLYzx auOqrTJZUJBvDQLmf43MAiD24SGM84vUvk0oxv3XCx+8jrAdS9yxAeU+4maqclipemgt 1kBj1pmUbqKoEExSYndNNAbFYfdJS928hsRU3Once9aOrNY/+8Uy2sQ3+QS4G8BuvQ8y tku+K63DEGkneZcualhnAbqBCE0kIFZTcAeVtawXed9m5tAM1JQCda1rWk3Xlem2CkqH TDQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=to:content-transfer-encoding:mime-version:message-id:date:subject :from:dkim-signature; bh=OwLPrJdI4Z1uvLNd2yV6gMbrl6XcEjBApLM51JERneY=; fh=u94vpSnbACPnIkIPa1XdGqhjZt/kxdbqUA9AiFps/bg=; b=irqnI6Vx0z9m00H5jWiA5n0wTsUPqey5u0kQIAXDATWvM3eC+KTxHUVyBVGKHcnu2D D0DKMZw75oxDYkG0iWf1NTB6FTZimSGrSL3GXxqihU2HnCZzKwVUkB+nDuLaf2qR382W myUy6Z7vBKsFJd0NX+yCP0p/GOqytdGq7T6834KkIwX5bChGVf0ttbn4CHPo6LTGJF+Z KFTU0jUZOCnvds8QwUWw7J46v94bp3MasqC7uWTXjBWT/aYErHSSoBOfu4h2VR4Lk1Hz febqR2oWFguGYhWDjBBELWn1UTrROHcAhtoAcebytgXl4HDqNueARmbnLLrMff3yl7iC QzIA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=CEoFbVvK; 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-48e1d82fdb5si773519f8f.260.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=CEoFbVvK; 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=Content-Type:MIME-Version:Message-Id:Date:Subject :From; bh=OwLPrJdI4Z1uvLNd2yV6gMbrl6XcEjBApLM51JERneY=; b=CEoFbVvKHAA643onqxj R3+ZpiFPqdpYoB5dyMadJMIuo3MxONdJot8Lc3M4ijYCkjVTzkXLaxdN3lj5sukeZucF5n9Q3lBFF j8eBsPwqKmpA4FTTXRRj2UuRWdmZFkCWdEdsdcfRFFUHY7hivlLqpp+wkFWRK3q4phPrd879Gu6b1 rGVoTVymxRexXqQ2Am6Sz0kE2ge0MMjfa3tGU67LkKae39/t4dpLflPw2BKUVK8wB/xSJpnQokwPO cchD1NX82p5+HG4uWtvr6AUpYcVNNAOThreQjwur/Tiihj+G/wFX7jUOX/dskoFEXIEZK0DS7HbSf uL2ybJ5pfAeRk+A==; 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-0f; Mon, 19 Oct 2026 21:47:28 +0200 From: Konstantin Khorenko Date: Mon, 19 Oct 2026 21:47:32 +0200 Message-Id: <20261019-b4-prep-khorenko-vstor-149854-selftests-test_memcg_sock-v1-0-efbfa45dc967@virtuozzo.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIANRz1moC/yWNUQ6CMBBEr2L2261sQQSvYgwpdaUVbU0XidF4d 4v+TDLzJjNvEE6eBfarNySevfgYsqH1CqwzYWD0p+xBF7qmglrsK7wnvuPoYuIwRpxligmpapt thcLX88QyCS7a3fhmh06iHbG2TV2dTEk7U0JezyNn//w9H8BZj40iOP6BPPoL22n5Xaq9EcY+m WDdEsXkBx82/wCTowJrRVoVqInUVitSWqunml+ZxPkFn88Xan/7c+cAAAA= X-Change-ID: 20261019-b4-prep-khorenko-vstor-149854-selftests-test_memcg_sock-6c864da317a3 To: devel@openvz.org, Konstantin Khorenko X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2992; i=khorenko@virtuozzo.com; h=from:subject:message-id; bh=B0lLcXbTudE4VFFFzTdCnv75YqYr9vqE+Yeq3E9NO+U=; b=kA0DAAoBUZYKR/lhXCoByyZiAGrWc9ehSAOH0LHqMa8fq8I/RckPqBnip26qYjGDsRs3rNhJH 4kCMwQAAQoAHRYhBFYPbcg9xdPQY70ILFGWCkf5YVwqBQJq1nPXAAoJEFGWCkf5YVwqDMkP/0Bc JbS7IEJB1uK7oT5cNxAmT21Pdug0eDwxPd84Gg+EtmUDazlbJodfry1B/I8nGRDDrskJa01PBrx Gb4MmkGQImaTSycJlZAUHZQqATdNoHLStqfT+QrSyZpIuWRjuPjyKsAujrvZVbzoFJAGXqbPVHH dAY626rxH1o1mooLr5ATzOrEWfMOKFTlTPL3ZoBOgo0zR3oyIafB3T0eEoM6oXhcUK2GmEFXCSU erv92I42fIHm0JwIgQ8VLR72dPOb4zYBbcLvtHj8uFUSF8SLk7fM5p35XpfnKY64xNFYBlCVtyE RtYZSTSmQDcCyjeGkhh1uoNjLU6SiN1IiJtJtCRyojI5V8sELRHdfAphZMGNt/SjVoxsQjr+6pe rItxdgpGFW3lYmBnRTyrymWpL2f/ecXcsaVOTnT+owuo0oRwrGwxnlUV3fO/5PKslrRLMi9rgae hwiIQD2irIuBdfp+bbkkNSkUeO99d9ZDlF4exrM4NZYHQhDIZnabklaMs0vc3a86HW3AXQzQJnj g+Dt+AONUnCJAEk2vPF8gk1KzosfoImPkx6pKPpy36D6BZmWrUJsuu/ua5thBpGOsCtFafolk0e SYEkxjI25hiYomdnIt1KwDKD38VkigHjSpSqyRcMvlHPEhqyn5vNwZZmVLmzvePrk7/jlouYZVs sWLfL X-Developer-Key: i=khorenko@virtuozzo.com; a=openpgp; fpr=560F6DC83DC5D3D063BD082C51960A47F9615C2A X-OZ-Fwd: true Subject: [Devel] [PATCH hci-8.1 0/2] selftests: cgroup: fix the flaky and vacuous test_memcg_sock 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 test_memcg_sock compares memory.current of its cgroup with the "sock " entry of memory.stat. memory.current moves at charge time, "sock " only when the memcg stats are flushed, and nothing in the test makes a flush happen. So the test either compares 0 with 0 and passes without having checked anything, or fails at random. This tree is worse off than mainline was before the fix: the final check reads "sock " once, right after the connection is closed, with no wait at all. Mainline polled for 3 seconds there (6360d444ae32), this tree never got that commit. It fails here ============= 10.193.16.26 (4 CPUs), test_memcontrol run 100 times before and after the series, interleaved: kernel before after 6.12.0-211.52.1.22.8.vz10 (release) 0 failed 0 failed 6.12.0-211.52.1.22.8.vz10 (debug) 5 failed 0 failed Every failure on the debug kernel is the final check: the client part of the test had passed, the single read still saw the socket memory. The release kernel passes here only because the machine is small. A memory.stat read flushes once MEMCG_CHARGE_BATCH pages per online CPU of updates are pending, so on 4 CPUs the test traffic crosses the threshold by itself. On a 48-CPU host mainline's test failed 8 of 30 runs on a debug kernel, and most of its passes compared 0 with 0. The patches =========== Both are in mainline's cgroup tree, cgroup/for-7.4: https://lore.kernel.org/r/20261012-b4-prep-vstor-149854-let-test_memcg_sock-compare-flushed-sock-stats-v1-0-bc864b1950ad@virtuozzo.com - 1/2 skips the test under cgroup.memory=nosocket, where no socket memory is charged and the test can only pass on 0 == 0. - 2/2 makes the test cause the flushes it needs instead of waiting for them: the client keeps the data in the server's socket and reads until enough socket memory has moved through the cgroup that a memory.stat read must flush, and the final check allocates and frees anonymous memory in the cgroup before it reads "sock ". The backport differs from mainline only as the Conflict: notes say: - 1/2 sizes its buffer with PAGE_SIZE, mainline renamed it to BUF_SIZE - 2/2 replaces the single "sock " read, not mainline's poll https://virtuozzo.atlassian.net/browse/VSTOR-149854 --- Konstantin Khorenko (2): ms/selftests: cgroup: skip test_memcg_sock under cgroup.memory=nosocket ms/selftests: cgroup: make test_memcg_sock check flushed sock stats .../selftests/cgroup/lib/include/cgroup_util.h | 3 ++ tools/testing/selftests/cgroup/test_kmem.c | 2 +- tools/testing/selftests/cgroup/test_memcontrol.c | 56 ++++++++++++++++++++-- 3 files changed, 55 insertions(+), 6 deletions(-) --- base-commit: 8026fb5599f945a36a6911f8febad3ab569176da change-id: 20261019-b4-prep-khorenko-vstor-149854-selftests-test_memcg_sock-6c864da317a3 Best regards, -- Konstantin Khorenko _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel