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=1795970869; b=oZUxklpfhsrZv0ngD1tvBSkCayAX15IhZl8qs3AvCEuyOo0C9VHpLHk4Oz8j/dM0cFEx rIVZsfCRMZ0XghHiHOgOWGlXp9EjsKM+MZCgJZ7nJUd2Mp+qtvF/+XKxcJxrZ7N+HdgYT xsOWgn+NPxL9qopSkv9ZPb/c5X+wuJjOOkGNE1q/3Y3Us/3Z88+zuqlmnbejfwkQZxyhY JKHcISoUj6KpBl1dUiHQEJA/aDzNp5Z9yy5lVASHLpOnHSxthAG8lp+EdvwEEMEgkoykt 60D+wbSN2ICKs8GHE70OWGdGBhA7FuvQIYtVKzdt6PGyiv2Eq9NGfvqPvTWo6/j7+0w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795970869; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=nRkY8F65T5MYBuR0rE1cWVkdC08/yC6oLq4L6Q6//U4=; b=aOSS/9IICTbeSJxpWsHnaXdqNmDNo66o5DQdd2i0Lf5jKHHOdhjuTsKxO5T+EkUR7880 vsgyKFicY238XNDcTpTTzslD+k1kJgRU02CirD+4N+G90rDtnyJN8atDVtMvm1DFUZu88 XlvfEFE7swL6OKMm0EEvtsWpQ6bkZTb5kDMXtgLvg2Uxi/5DZF0kOgzQePXEIM4dkAgbp n1Gm8Parwt04kjtGUjTdqlY2l2PUoqBj0nZUXSwBKtLFakA+JXWeBnO0P2ElspxE7ElvE Cb/bMUM5x7HW8WXk3wwVOB1DXXv8H0xNDOoxQQp/2/mF78dkTfWq/oTaMiza2Uah5rA== 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=iFL6pr7j; 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 EA770606A31C for ; Sun, 29 Nov 2026 16:47:48 +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=iFL6pr7j Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79F521F00897; Sun, 29 Nov 2026 16:47:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795970868; bh=nRkY8F65T5MYBuR0rE1cWVkdC08/yC6oLq4L6Q6//U4=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=iFL6pr7jvLCKcP/V3HG1DbT4EqvCU6ErvjRJS7eq4lTAG+sx07cmPBRmNloxzTKZY xSJNw6+C0m7aLmZljSKLojLmpiWX0ajm20Oz4ZTGf6uKMZMwRfjT2wHT8pPlHsgNyu GAoXudw6hPFB/PiTOubA6IUm+pwVdihc3DjKcfaLVkQZjpKxHarKEzOcZbsF1z6bpX 1cmDtQMkyxavy8lcQPTR42Z6HwQKlRVL3rqlvqQ3AgEZFq90UH+u2E7VQ4lXK7+g6P /CjyAU/tWmHdugqN7zohbwXpMww3leVBCe0RX6OSJSMRZBrMDVtoLV4SaKRti+fLDx f97n5iIOHl5Wg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH sched_ext/for-7.5] sched_ext/idle: Skip nodes without CPUs Reply-To: sashiko-reviews@lists.linux.dev To: "Cheng-Yang Chou" , sched-ext@lists.linux.dev In-Reply-To: <20261129163536.15478-1-yphbchou0911@gmail.com> References: <20261129163536.15478-1-yphbchou0911@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sun, 29 Nov 2026 16:47:48 +0000 X-Mailing-List: sched-ext@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] sched_ext: missed update_idle_cpu_nodes() on hotplug during enable -- commit 49bd96c9c4b1ca8a5782568b9a5893b41d485588 Author: Cheng-Yang Chou sched_ext/idle: Skip nodes without CPUs This commit maintains a nodemask of NUMA nodes that have at least one active CPU (scx_idle_cpu_nodes) and restricts cross-node idle CPU searches in pick_idle_cpu_from_online_nodes() to those nodes instead of all online nodes. > diff --git a/kernel/sched/ext/idle.c b/kernel/sched/ext/idle.c > index 922fbc3065ccf..73af83231f747 100644 > --- a/kernel/sched/ext/idle.c > +++ b/kernel/sched/ext/idle.c [ ... ] > @@ -414,6 +434,8 @@ void scx_idle_update_selcpu_topology(struct sched_ext= _ops *ops) > static_branch_enable_cpuslocked(&scx_selcpu_topo_numa); > else > static_branch_disable_cpuslocked(&scx_selcpu_topo_numa); > + > + update_idle_cpu_nodes(); > } > =20 > /* [Severity: Medium] Can scx_idle_cpu_nodes become stale if a CPU hotplug event occurs while a scheduler is being enabled? scx_root_enable_workfn() calls scx_idle_update_selcpu_topology() right before cpus_read_unlock(), well before enabling __scx_enabled: kernel/sched/ext/ext.c:scx_root_enable_workfn() { ... for (i =3D SCX_OPI_CPU_HOTPLUG_BEGIN; i < SCX_OPI_CPU_HOTPLUG_END; i++) if (((void (**)(void))ops)[i]) set_bit(i, sch->has_op); ret =3D check_hotplug_seq(sch, ops); if (ret) { cpus_read_unlock(); goto err_disable; } scx_idle_update_selcpu_topology(ops); cpus_read_unlock(); ... } If a CPU comes online or goes offline after cpus_read_unlock() and before static_branch_enable(&__scx_enabled) (while tasks are being initialized), handle_hotplug() skips scx_idle_update_selcpu_topology() because scx_enabled() is still false: kernel/sched/ext/ext.c:handle_hotplug() { ... if (unlikely(!sch)) return; if (scx_enabled()) scx_idle_update_selcpu_topology(&sch->ops); ... } When the scheduler has ops.cpu_online or ops.cpu_offline defined, the hotplug transition is accepted without aborting enablement, leaving scx_idle_cpu_nodes out of sync with cpu_active_mask once the scheduler goes live. If the first active CPU on a node came online during that window, pick_idle_cpu_from_online_nodes() will skip that node until the next hotplug event. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261129163536.1547= 8-1-yphbchou0911@gmail.com?part=3D1