From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796314931; b=ccfAbiVCo9pEqc9tvkN6Lvgd1SetSpsFwEBKgssOQdt5M7PQVLGzojgYrh7mef4HTFtM QmKhtlA086upJPlvGwsqHniah/9PkpPSt0mP16mARDr2uh8g2MSGpVIwViV9xnfURop9a hYXtV2NX9JLfUyVZKx+0VgmX9K2JueBJFenPWJzgmhF/clFhswyQ2iUzAhZqbSOdn77wm B3mnzOIPW/5sVWSl0ps89cxoOrDGcgq2Ovs6WyWeaH6AYeZ4dYjy+4dpGheQJPOYxcHsJ K+w1dTR159Xy6SmrcyU4unKjeIwwHAwNMFMD+MBSlYkOHh8mPnCwaI3nBcTuuPbC0ig== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796314931; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=Lwyu0bSA7GHgNtx9EAJSxHHRY+sM1v0GlMSbV5EkDng=; b=UEJhI/H2FRlCzsSn95S0oSZnG46zjFkkfApN+eHceywGTNO/QRNWK/5cgkpf+jh8AXP+ kK1fYTghJFCJ+6FdxXuEopgdxm+XvTJIpecGXTcfqkeH/1BMGBGHK1l/Xi9TRV/EalirN rYE3GRoNCgfCeWuvhU7dFxutauakdvXeBLaskiD50BCOkDCpSrdxEmpiRbW+/C7QALrwf CdrUj667+7J4ewmMHdx3n/+HqCd3/7rBghMUQbhjw+3y3EmOcVLEQKcvDAesXOwQpBsWZ Ja9nDACIihkYgMvcek88vTrP4eiBNiilGpwKki5JYL4I1+iCULdame5WXiHHaY/LXlQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=bME3W1SO; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A5172606A685; Thu, 3 Dec 2026 16:22:11 +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=bME3W1SO Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46F4C1F00929; Thu, 3 Dec 2026 16:22:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796314931; bh=Lwyu0bSA7GHgNtx9EAJSxHHRY+sM1v0GlMSbV5EkDng=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=bME3W1SOS9f/nGoAO8tyZul/2CvftrXUoYH9ZnwkWZwls77BKiLy2oarlGdnmaBBr Xc0p2vSGxieOWC/hXgXwIVK/11Fh6klI8S4aOrd6Zj7nfEmKWSzE4M3U0ffSqMWPgz hkWoULOAvUb0cXs68CBQYVJ+bQh1S5NdnSWFje27YMo2AYUFxlGs5Bh5BrLor8PtSz wiyz+364wzCvGjO75XBoVZmP6HlsAF3QZPQWCTEANChH6ihH7S0pGRffkPkn5e5sTq NNQFvqKI+APGQ2fuytmBmVSLISk7nadp0aQzCN3fBGIpgGTkYP+mzQU/p7i8J0jn65 5cCeskZ4HjqcA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v14 16/39] cgroup/cpuset: Wait for an attach before rebuilding the sched domains Reply-To: sashiko-reviews@lists.linux.dev To: "Mathieu Desnoyers" Cc: linux-rt-devel@lists.linux.dev, tj@kernel.org, hannes@cmpxchg.org, mkoutny@suse.com, linux-kernel@vger.kernel.org In-Reply-To: References: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 16:22:10 +0000 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Low] cgroup/cpuset: duplicated cpuset_full_lock() in cpuset write handlers - [Low] cgroup/cpuset: commit message inaccurately claims CPU hotplug never waits -- commit e516c72d81ecf2f1dd9c839b6545bc2ce4e858aa Author: Mathieu Desnoyers cgroup/cpuset: Wait for an attach before rebuilding the sched domains This commit updates cpuset_full_lock() and rebuild_sched_domains_cpuslocked() to call wait_attach_done_lock() instead of mutex_lock(&cpuset_mutex), preventing sched domain rebuilds from dropping deadline bandwidth reservations made during a cpuset attach. > Fix this by waiting for an attach in progress in > rebuild_sched_domains_cpuslocked() and in cpuset_full_lock(). The > latter then takes its locks in the order of the writes of cpus and > cpus.partition. Two kinds of callers never wait: > - a rebuild from CPU hotplug finds no attach in progress; [Severity: Low] Is the claim that a rebuild from CPU hotplug never waits accurate? cpuset_can_fork() also increments attach_ctx.in_progress on CLONE_INTO_CGROUP without holding cpus_read_lock(). CPU hotplug reaching rebuild_sched_domains_cpuslocked() can therefore wait for cpuset_fork() or cpuset_cancel_fork() to finish. Memory hotplug via cpuset_track_online_nodes() also calls cpuset_handle_hotplug() under cpus_read_lock(), so it can wait on regular attach migrations when subpartitions_cpus is non-empty. [ ... ] > diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c > index 194a438e25c31..51b6be4607946 100644 > --- a/kernel/cgroup/cpuset.c > +++ b/kernel/cgroup/cpuset.c > @@ -296,17 +296,20 @@ void lockdep_assert_cpuset_lock_held(void) > lockdep_assert_held(&cpuset_mutex); > } > =20 > +static void wait_attach_done_lock(void) __acquires(&cpuset_mutex); > + > /** > * cpuset_full_lock - Acquire full protection for cpuset modification > * > * Takes both CPU hotplug read lock (cpus_read_lock()) and cpuset mutex > - * to safely modify cpuset data. > + * to safely modify cpuset data. Waits for an attach in progress before > + * it takes cpuset mutex. > */ > void cpuset_full_lock(void) > { > mutex_lock(&cpuset_top_mutex); > cpus_read_lock(); > - mutex_lock(&cpuset_mutex); > + wait_attach_done_lock(); > } [Severity: Low] Now that cpuset_full_lock() runs this three-step sequence, can cpuset_write_resmask() and cpuset_partition_write() call it instead of open-coding the same locks? Duplicating the sequence risks future divergence if the cpuset full-locking order changes. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/cover.1796296313.gi= t.mathieu.desnoyers@efficios.com?part=3D16