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=1796152316; b=cOMCgAvN5S/26h3TMUiGYsaI88cHoG1bSwh3HZ8Si/Lg3Rphz3kdYUAvKQP1AljIBvpg Cfz6/N/H6yVrhRMe6j95iwCg3uIDfrutHDIbJImg7bM6wLjxWjFOJmA8d/kk9sP3k1HAC ZNY2M0gRX14A38CqWDKP2J2tRMMpe1WIBXIj5jr0u57qVm+Uu18oNsAaMNzPU9nZYw5Y+ IWSa7B+l9bFXQQotBs8hUBj2Z8v2Z//nmuSKPKBUcUy6vUw8aarHBp6JIr1BmE+8KL50J RRkXo6DZ02RmKg+uNwKBKqS3SlQAQhFLWPc4PvZzDR/U0eck0jYMECL7vo/lQdZsqhQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796152316; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=UnuxYc3jEO8uADIUzFC4kSonxDaF4uJNVQEK6ECVFxc=; b=4512ilFKSpbJRXXzK32nfQpWaIfN983jZo6tp7ufF4FddX27rB61B+pRxZrT1u3O7Jlp xvcqVDB6qeb1YBCrRdcqd+VlTsUNueKmLa2DJLHncH42Bm0mhk4qiz/kiNIw+B/62GYzA Y2uct3yE99bU+Ju9WXdHVGG+OeVjUFMp4fK5gJyduhVhMuRQ+AQIVESchj3XnrZiIjmzI TdyEJOHfT2u+zL8dEjIucFHIhim0Q/O168Q+5Fd6Q2j+o6QtQXCq9jh5lt12SoNhzAUEU LDGLtC9dsKwDGT540NS3yrfTdC5ldt/pQZ4AXW6TAA0OGZ+kVOSKDKaHcpPHK9F4tig== 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=DkrzmXaO; 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 C74C3606A31A; Tue, 1 Dec 2026 19:11:56 +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=DkrzmXaO Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5336F1F008A0; Tue, 1 Dec 2026 19:11:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796152316; bh=UnuxYc3jEO8uADIUzFC4kSonxDaF4uJNVQEK6ECVFxc=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=DkrzmXaOKvZFeslZVftj0lz1YoS0in7um3P8ljzFJDacgNjoOxA4TCrZSKwVQUl4V MRp6lTiAUYPBbfWRHhEjGXmoVl1iJGSeYtQiZmqy2r1GVaGnm5cYCrS8IIK8b552Ca ds3Nf+TS10W9zKXUHiY9FzpHxgrSJ9SBSlD+eQCR/IX9dHN0qEwJC1uEb/GvQkQeTE x5kikpFVhnBVhxIVDlyyw5lm5OZ1h9QDt+gc4Go7RBvDxPoZtvgT3Y0joUdYKQkZbM rHvPia4AyfY+/Noht3PYWntMNN65CtxRf+vKZnAXfDPyaja9/FkydrGadUBRGWdMwk hiNT6s82Iwc6g== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v13 18/36] sched/deadline: Make a rebuild count a task in the root domain it runs in 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: Tue, 01 Dec 2026 19:11:55 +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 1 potential issue to consider: - [Medium] sched/deadline: missing dl_bw_gen check in __dl_task_bw_move_cpu() -- commit 7839622ca2175dc96fddcd96c7f89dcd473e1cdd Author: Mathieu Desnoyers sched/deadline: Make a rebuild count a task in the root domain it runs in This commit introduces dl_task_rebuild_cpu() to select the root domain where a deadline task's bandwidth is counted during a rebuild, leaves out live tasks that have no active CPU, and switches dl_get_task_effective_cpus() to HK_TYPE_DOMAIN_BOOT. > diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c > index f618fee64f5bc..4b3c73c2a0d34 100644 > --- a/kernel/sched/deadline.c > +++ b/kernel/sched/deadline.c [ ... ] > @@ -3992,12 +4059,20 @@ void dl_add_task_root_domain(struct task_struct *= p) > return; > } > =20 > - msk =3D this_cpu_cpumask_var_ptr(local_cpu_mask_dl); > - dl_get_task_effective_cpus(p, msk); > - cpu =3D cpumask_first_and(cpu_active_mask, msk); > - BUG_ON(cpu >=3D nr_cpu_ids); > - > + cpu =3D dl_task_rebuild_cpu(p); > raw_spin_lock(&dl_departed_lock); > + if (cpu >=3D nr_cpu_ids && list_empty(&p->dl.dl_departed_node)) { > + /* > + * No active CPU can count the bandwidth of this task. Leave it > + * out of this rebuild. dl_bw_gen then keeps its release from > + * removing anything. A later rebuild, or > + * dl_task_offline_migration(), counts it again. Do not leave > + * out a departed task: the code below counts it on the CPU > + * recorded, if that CPU is active. > + */ > + goto unlock; > + } [Severity: Medium] When a rebuild leaves a sleeping task out because its allowed isolated CPUs went offline, p->dl.dl_bw_gen stays behind dl_bw_gen while p->dl.dl_bw_cpu still points to an offline CPU whose runqueue is attached to def_root_domain. If the sleeping task is then moved via cpuset_attach to a cpuset with active CPUs in def_root_domain (such as an active isolcpus=3D"domain" CPU or an isolated cpuset partition), can __dl_task_bw_move_cpu() and set_cpus_allowed_dl() skip accounting its bandwidth in def_root_domain? Neither function checks that p->dl.dl_bw_gen =3D=3D dl_bw_gen before treati= ng p->dl.dl_bw_cpu's root domain as already counting the task: kernel/sched/deadline.c:__dl_task_bw_move_cpu() { ... cpu =3D dl_task_root_domain_cpu(p); if (cpumask_intersects_and(cpu_rq(cpu)->rd->span, new_mask, cpu_active_mask)) return -1; ... } kernel/sched/deadline.c:set_cpus_allowed_dl() { ... if (p->dl.dl_bw && !dl_entity_is_special(&p->dl) && cpu_active(ctx->dl_bw_cpu) && cpumask_test_cpu(ctx->dl_bw_cpu, ctx->new_mask) && cpu_rq(src_cpu)->rd !=3D cpu_rq(ctx->dl_bw_cpu)->rd) { ... } Because def_root_domain.span contains both the stale offline dl_bw_cpu and the active destination CPUs in def_root_domain, __dl_task_bw_move_cpu() returns -1 (and set_cpus_allowed_dl() sees matching root domains), so cpuset_can_attach() skips admission control and the task's bandwidth remains uncounted in def_root_domain. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/cover.1796146461.gi= t.mathieu.desnoyers@efficios.com?part=3D18