From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9D1D7606A31F for ; Sat, 5 Dec 2026 18:42:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=X3s2qhTZ Received: by kanga.kvack.org (Postfix) id 33DFD6B05B3; Sat, 5 Dec 2026 13:42:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2ED526B05B4; Sat, 5 Dec 2026 13:42:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1B6356B05B6; Sat, 5 Dec 2026 13:42:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 7C1356B05B3 for ; Sat, 5 Dec 2026 13:42:28 -0500 (EST) Received: from smtpin20.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 673B914059A for ; Sat, 5 Dec 2026 18:42:26 +0000 (UTC) X-FDA: 85510799892.20.1A06674 Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by imf12.hostedemail.com (Postfix) with ESMTP id D29A64000D for ; Sat, 5 Dec 2026 18:42:24 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=X3s2qhTZ; spf=pass (imf12.hostedemail.com: domain of sashiko-bot@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=sashiko-bot@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1796496144; b=LT3Dq8wTrKvwD/Y9BrNW5TEWWRNb/6zOidNq26PQudAw/TzQDEaOmaieDD/ZYeKb/9LPwj 6HzbAx/BZALyChlLvRGeZD/dCGemVwJsS0FVTpATF8Oxl0doit+QiY847vV6/MGUEegnU6 kA9H//QHvoKA0/3PXbqHtVDy66A01s8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1796496144; h=from:from:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=NWS7jc+UXpd6ydP1NZJz777654a79Ev8ba9nyx08784=; b=bIwH/KBn9y06rjAGmATSFxkgQll+kmnNz5nVQh+HcvYs2pW0240DtZeoi5bzX3U44P9R8o CQQ+siQrRm3ObtKt7OvM/urF55EIX5lFWNz3T1oNUa/xx+q0ceCPdyIMMwfJoL/zGz6osF i6XbrLLDQSxrD6eqgDReDE8qGc9fp0M= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=X3s2qhTZ; spf=pass (imf12.hostedemail.com: domain of sashiko-bot@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=sashiko-bot@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 71A3B60F04; Sat, 5 Dec 2026 18:42:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F7071F0092B; Sat, 5 Dec 2026 18:42:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796496144; bh=NWS7jc+UXpd6ydP1NZJz777654a79Ev8ba9nyx08784=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=X3s2qhTZQdKfU+/Yh0PtOySlB1r1u+wN/XTextploCdsc/pAxICMIyDVPrryuPg+s q38RlJt/iU4IHgpR9Mhj1xNv++wV0gklBrKGgY3biUp3tAwpWYDburFGaHnQ4/SlR9 8wbG5SkBXiyGquVM29OUM9F2MA57s2hAnid8DVPSpRNvQrIOQegFjDrmAxdIQzqqjU lo4fkehEEQL0URWSuXCv4iOR6R4omzbGczVOfIcQQ8w6DufkYaTqPRfSTqk+CGlLBA nA2gPJ9NBQdhXtG/mQfFAeGHN/iAzms6d+jq9rALkpjX2BL1bXXNMFlhJv3/NgAtm6 5D8XOTnSkCOtw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v3 08/12] selftests/cgroup: test the frozen state of a cgroup with tasks and children Reply-To: sashiko-reviews@lists.linux.dev To: "Shakeel Butt" , "Tejun Heo" Cc: "Andrew Morton" , "Johannes Weiner" , "Michal Koutny" , "Michal Hocko" , "Roman Gushchin" , "Christian Brauner" , "Oleg Nesterov" , "Sebastian Andrzej Siewior" , "Suren Baghdasaryan" , "T . J . Mercier" , "Usama Arif" , "Meta kernel team" , linux-mm@kvack.org In-Reply-To: <20261204184041.1489976-9-shakeel.butt@linux.dev> References: <20261204184041.1489976-1-shakeel.butt@linux.dev> <20261204184041.1489976-9-shakeel.butt@linux.dev> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 05 Dec 2026 18:42:23 +0000 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: D29A64000D X-Stat-Signature: cai3hisae6phn8dodkzjqnghxyasxmti X-Spam-Status: No, score=-11.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-HE-Tag: 1796496144-131105 X-HE-Meta: U2FsdGVkX1+JCKsctI79YpFuVNjkqshtyHibd2TRviVI21Id14k44hdc1RJJkDRWqrAiHktSY3w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ABC8twss3fknmXisg4nkJk3AhFfjTc5+78YTJsUxkfuHZUM1kY5Vjh0PYOM4vpTuNOUof43+0+EHPDrPjG63ioPy1ZeW/Xpa55rKLzTEwMTnPGOYo/Gac66uYfSZDBKWhQo5W0t3yUpAhnWdl+RAQa3Q4RA7FYInMwM2dy5QrtA0aQUOPJXc7fhZnatz/PWbV2rN2WaQw3ogTLj6xyEHZLBIlJyXrfZVoUjAtL0K2DDTCGnsD79EJp+IrmR0EyeHqNBbJ2h6rqovq+XU1vRRArpjAfEKDmEZpFzsZ/AQUW5mEiogfc/r91UaiLRQLQA67K+LRhUmB2cvf2ptQD2DJvb4o9W9nkUXFXBOIpCDE5VEan2XSReieU1psuyIvWpBNHnbLOkV1QriJeCLQH0D1htFiO8wBPmiUwi7KCNhfaYwwDeCR+f8GMTklcsW0RzO7FcHALj9rkalr+8q0JCk5z24lp1to+QJhsGxmiqksAC8AvcLDRwtn3WHBZYT88L1DTWjC/cqcV8FhWobNuau/5jaJqIptDi2AT2DSCJJib7j5WmTqoax/z9vDb4weocV1QZ075QKqkQUjzQBMtnY4urLapt7BE6vsa8ik8BJYdRao4t+tfmCXBvfZflYNwBSvtDO7yjg+Xmwl94VkwCsDye+LnptCz8BHb9zPxA Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] selftests/cgroup: test_cgfreezer_nonleaf() omits frozen-child unfrozen-parent -- commit 50b37a92c7dfe03a60048f4a7da721b1bcd9ef30 Author: Shakeel Butt selftests/cgroup: test the frozen state of a cgroup with tasks and children This commit adds test_cgfreezer_nonleaf() to test_freezer.c to verify that a cgroup with both its own tasks and a child cgroup reports frozen only once all own tasks and descendants are frozen, and does not stay frozen after a thaw. > diff --git a/tools/testing/selftests/cgroup/test_freezer.c b/tools/testin= g/selftests/cgroup/test_freezer.c > index 266b1a0f889f5..92dd743ca7bb6 100644 > --- a/tools/testing/selftests/cgroup/test_freezer.c > +++ b/tools/testing/selftests/cgroup/test_freezer.c [ ... ] > @@ -804,6 +805,112 @@ static int test_cgfreezer_vfork(const char *root) > return ret; > } > =20 > +/* > + * A cgroup with tasks of its own and child cgroups is frozen only once = its > + * tasks and all its descendants are frozen. > + * [ ... ] > +static int test_cgfreezer_nonleaf(const char *root) > +{ [ ... ] > + frozen_pid =3D cg_run_nowait(child, child_fn, NULL); > + stopped_pid =3D cg_run_nowait(staging, child_fn, NULL); > + if (frozen_pid < 0 || stopped_pid < 0 || > + cg_wait_for_proc_count(child, 1) || > + cg_wait_for_proc_count(staging, 1)) > + goto cleanup; > + > + /* Freeze one task in the v1 hierarchy and stop the other. */ > + if (cg_enter(v1cg, frozen_pid) || > + cg_write(v1cg, "freezer.state", "FROZEN") || > + cg_read_strcmp_wait(v1cg, "freezer.state", "FROZEN\n")) > + goto cleanup; > + > + if (kill(stopped_pid, SIGSTOP) || > + waitpid(stopped_pid, NULL, WUNTRACED) !=3D stopped_pid) > + goto cleanup; > + > + /* > + * Freeze the parent and move the stopped task in. All of the > + * parent's own tasks are frozen now, but its child isn't. > + */ > + if (cg_freeze_nowait(parent, true) || cg_enter(parent, stopped_pid)) > + goto cleanup; > + > + for (i =3D 0; i < 50; i++) { > + if (cg_check_frozen(parent, false) || > + cg_check_frozen(child, false)) > + goto cleanup; > + usleep(10000); > + } > + > + /* The thaw doesn't wake the stopped task, the parent stays thawed. */ > + if (cg_freeze_nowait(parent, false) || cg_check_frozen(parent, false)) > + goto cleanup; > + > + /* Once the task is thawed in v1, the whole subtree can freeze. */ > + if (cg_write(v1cg, "freezer.state", "THAWED")) > + goto cleanup; > + > + if (cg_freeze_wait(parent, true) || cg_check_frozen(child, true)) > + goto cleanup; [Severity: Low] Should test_cgfreezer_nonleaf() also cover the symmetric case where child reaches frozen=3D1 while parent still has an unfrozen task of its own? Right now, frozen_pid is only placed in child and stopped_pid in parent, so only the frozen-parent, unfrozen-child case is tested. Commit "cgroup/freezer: check own tasks and descendants for the frozen stat= e" also fixed upward propagation when a child finishes freezing while its pare= nt still has unfrozen own tasks. Without testing that direction, a regression in that half of cgroup_frozen_state() would pass undetected. Reusing parent, child, and v1cg to place a v1-frozen task in parent while letting child freeze to frozen=3D1 and checking that parent stays frozen=3D0 would cover both halves. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204184041.1489= 976-1-shakeel.butt@linux.dev?part=3D8