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=1796151758; b=V8jJfsDckMr7mBWHlFI1rT9EuQwEL9eg7sh7o5NcdeGg0meYBCvNUWHo7ndtOOHgmKD9 5roHGei97Xqw5WfPzYx2ybXV8/8KKVMs4H2NlD3Q87G8nMT21VVh6aZE/Qs1o6zu300bQ dWXuUrtQOiCNhnc0goXQxeAvZW4XNqxaU8aAQHlTELt2EGBQuVRI+uB77QHhIM+RzMYP+ TMYwsUEtAHFD8w7bu64mKVnHTUoFQ/jV4RRU5Uzumpd1gCFDIGs6yAxCcw9qIhu8v926L rJ+6bgJyl5gXn7jidqwbSoRRydhMB/4IOUfDAx5rNyMaLBD1GxTkAz6gYfDJTQS5QuQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796151758; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=vYMqgc8m1qaneg2SZ8kL2HRf0K4w92SodD50OeJmb4I=; b=FTMJYcqTS4G63/WJV59g0A2MPe8VVjvrpfvh9976lsvnyUIWuyvSESN99r5v7Nfu7bVG 2e0aZkjvNp1uZMX1scRxrejhi4jh7rAYBdkVfG4511b0X8VEXhOODjt+xxhhLnwl9K915 UsVgxoiddRFCub2FTkGZ5Cg2HUxPhL/hGvs9obfqndiHkbxFiRCvd/SMg/UkzVs6yNZrh NlxrgffAB1tuGLQrhReU5UceIZlPcx4mdGWHyvJjpLz13DwHOxmm1tr8phc41EZvyCFsZ a/TDFt7JCLI/PYkHMxbyT+im8YpMPt8ikXrMi0ozN5ATQBVVYcTfqDaVGh0qgJ9oOPQ== 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=FgG3gnNJ; 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 B6CA6606A31A; Tue, 1 Dec 2026 19:02:38 +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=FgG3gnNJ Received: by smtp.kernel.org (Postfix) with ESMTPSA id BCC0E1F00897; Tue, 1 Dec 2026 19:02:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796151758; bh=vYMqgc8m1qaneg2SZ8kL2HRf0K4w92SodD50OeJmb4I=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=FgG3gnNJoxoEMtTvMEeMEbcy+wcdyCwSw/CN7+YWsOX6PRtbl6Nf/wfe5qgJfGTk7 12Ma/arwXYC37cv4A4znZm+RhSRH75LtA5jhW7Af8SpnKblnE+XCgjkrPm1HBGkTnj biu/Y69AT4JiQ1iPuDH+nJtAVhE7eqh/v5OTrIIaIqzp2MA9NroW6Pfg7rXxg9sKMF ObzdFl80/CIT+Gv5QKNF529AaTnOo2tl9DgtNkv2Pgkr9jZ2uSRlueMTT7ZvcrnsS9 wPSD2DhhHQHLnO6nQPK4YuWUk0W6SPyDEwB+TF/rJHIaNcJTDeW8n4709ptzKHgMRe p7l3oUsk+ZVPA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v13 20/36] sched/deadline: Keep a task in the root domain that counts its bandwidth 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:02:37 +0000 X-Mailing-List: linux-rt-devel@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/deadline: stale dl_bw_def for departed tasks in dl_clear_root_domains() -- commit 951a7fe2fe695c77ff8cf06e107558af78b19d1b Author: Mathieu Desnoyers sched/deadline: Keep a task in the root domain that counts its bandwidth This commit introduces dl_task_bw_span() and dl_bw_def tracking to keep SCHED_DEADLINE tasks and their bandwidth in the root domain that admitted them across CPU selection, hotplug, and sched domain rebuilds. > diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c > index 67dfd3e11832b..0a925f91ebec7 100644 > --- a/kernel/sched/deadline.c > +++ b/kernel/sched/deadline.c [ ... ] > @@ -4272,7 +4465,7 @@ void dl_add_task_root_domain(struct task_struct *p) > raw_spin_lock(&dl_b->lock); > __dl_add(dl_b, p->dl.dl_bw, cpumask_weight(rq->rd->span)); > raw_spin_unlock(&dl_b->lock); > - p->dl.dl_bw_cpu =3D cpu; > + dl_record_bw_cpu(&p->dl, cpu); > p->dl.dl_bw_gen =3D dl_bw_gen; > unlock: > raw_spin_unlock(&dl_departed_lock); > @@ -4428,7 +4621,11 @@ void dl_clear_root_domains(void) > * has not reached still waits for it: see dl_bw_move_blocked(). > */ > WARN_ON_ONCE(!(dl_bw_rebuild_seq & 1)); > - WRITE_ONCE(dl_bw_rebuild_seq, dl_bw_rebuild_seq + 1); > + /* > + * After the writes of rq->rd and of dl_bw_gen: pairs with the > + * acquire in dl_task_bw_rd(). > + */ > + smp_store_release(&dl_bw_rebuild_seq, dl_bw_rebuild_seq + 1); > WRITE_ONCE(dl_bw_walking, true); > for_each_possible_cpu(cpu) { > if (!dl_bw_visited(cpu, cookie)) [Severity: Medium] Should the dl_departed_list loop in dl_clear_root_domains() also call dl_record_bw_cpu(dl_se, cpu) when it re-counts a departed task's bandwidth? kernel/sched/deadline.c:dl_clear_root_domains() { ... list_for_each_entry(dl_se, &dl_departed_list, dl_departed_node) { cpu =3D dl_se->dl_bw_cpu; ... dl_b =3D dl_bw_of(cpu); raw_spin_lock(&dl_b->lock); __dl_add(dl_b, dl_se->dl_bw, dl_bw_cpus(cpu)); raw_spin_unlock(&dl_b->lock); dl_se->dl_bw_gen =3D dl_bw_gen; } } If the rebuild moved cpu into or out of def_root_domain (for example, when a cpuset partition changes between root and isolated), dl_se->dl_bw_def is left stale, and dl_add_task_root_domain() skips the task because dl_se->dl_bw_gen is already equal to dl_bw_gen. If priority inheritance then boosts the task back into dl_sched_class before its 0-lag time and another rebuild runs, dl_task_rebuild_cpu() will read the stale dl_bw_def and move the bandwidth to the wrong side without admission control. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/cover.1796146461.gi= t.mathieu.desnoyers@efficios.com?part=3D20