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=1796321129; b=wK0QDN8IPKF4/NxFdvTbK7fkrK8wtWrLVMpjBFWrKJbw5jr/jP6skqkwIU+FhmTf4wqP b9NlxTyMuNHPqYJ3+E311rzZXo+vwCDIZpRSWLUn7/L4GGcE+NLeiLTg6pOPU2ZsRp3Ws ZU6XBKOxGFj8FFDwcGiMhS1e1mTRQ6OwF4sYCBV2K51Dc2Nwm9vfw5ma2CxMlk31Jnjex 8ULHggkHqxEX9gBJvAPH9k7d069V9uxvAdoj7M/06wXglNtx/VWxcifLJC1eSV+b/Hzt4 POyfESP42Fa07PDH57ztuuEhdPaz1FbU2v5ZWMGRP3jpukEGr9J6qJF6yOZiGpxF7cg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796321129; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=smI0jX0uSDS1KHwPYErkIgQGFpdAg2h178VsdMvOTDA=; b=po51GT5ltMpmwXvoe6AqrBsTUbnYHgHa9h+Odw6DiuHPAi8CKFfUJsRWLe2KhgWiKJSr YsOcylunt/w8fGvPsdXgMZPw+t32scTHlrEca4Zmy9I4GF+40mnqI2rpUXA9xVnwtR6g5 clYXjH+nsmyzsJXKeSHbVDT3oMN5hK5pZpZ5jziK58C34/qHnuoVJqSA/3Mfw4wQT1MVy lQyb8HCbIiViJFiWfwrtuvzfk8LQr6yXLfaFJRIJQ6yjF8KZbLCed6Ki3oyl6QH5sKWZU +tPNIQyRa0zU9N0yBHTURSVf7iauPlsgkTIX6gv9vA9GbiL668q/efLwuoGU3mDDJiA== 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=mkVt6+df; 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 BB0CD606A32C; Thu, 3 Dec 2026 18:05:29 +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=mkVt6+df Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16EC61F0089C; Thu, 3 Dec 2026 18:05:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796321129; bh=smI0jX0uSDS1KHwPYErkIgQGFpdAg2h178VsdMvOTDA=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=mkVt6+dfni6QR5lOkD+ANKJh99DRsAXsXe/fSJkBDYyA5UI3JhBYBrLSu/jO9IfHR K9SO3+hNIKMROi8dEMCNV0uRgXleURLO9PorTnhFI3ziVYMg8QTDb3iwl35JaglpZl czxm/Hj2gG0PhyqH4AbxXdW7XUwKxKtbu58YOIFXKrwMCHcpRl4uGoATaMCMvjWtaV MBP/zK4mzQGR3jhAPZw+nXlnT3N6uP4mXQ3cQPB3FcVTsnqZOr7FskUqFQiy88pEu5 xt25qgRV+PB1qOltEuZ84aikmVdc/kkuMkCLxHMazC3ioONVA0PgMV0LjmCvxJbN/K PtTrIxBP80dGw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v14 37/39] sched/deadline: Warn when a runqueue keeps the bandwidth of a task 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: <971ed46848b9e82355ccaf53bd20f0736ec885c3.1796296314.git.mathieu.desnoyers@efficios.com> References: <971ed46848b9e82355ccaf53bd20f0736ec885c3.1796296314.git.mathieu.desnoyers@efficios.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 18:05:28 +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: - [Medium] sched/deadline: Cold p->dl load in set_task_cpu() on non-DL migrations - [Low] sched/deadline: Changelog cites __dl_clear_params() not dl_release_params() -- commit c63aaa2809cc1d85748f1c6385d4f67c969d9e4e Author: Mathieu Desnoyers sched/deadline: Warn when a runqueue keeps the bandwidth of a task This commit adds WARN_ON_ONCE() checks in set_task_cpu(), task_non_contending(), and inactive_task_timer() to catch cases where dl_bw_oncpu remains set after a task leaves the deadline class or before its deadline parameters are released. > - task_non_contending() or inactive_task_timer() releases the > bandwidth of a task while its flag is still set. They then call > __dl_clear_params(), which clears both the flag and dl_bw. After > that, nothing can take the bandwidth off the runqueue. [ ... ] > Warn about the first state in set_task_cpu(). Warn about the second > in task_non_contending() and inactive_task_timer(), before they call > __dl_clear_params(). No warning fires in the selftests of this series. [Severity: Low] Both task_non_contending() and inactive_task_timer() actually call dl_release_params(), which invokes __dl_clear_params() internally and preserves period_start and deadline for constrained-deadline tasks. Should the changelog refer to dl_release_params() instead? [ ... ] > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > index 2700c8e98b0ed..879ac7d6cdfd0 100644 > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c > @@ -3517,6 +3517,9 @@ void set_task_cpu(struct task_struct *p, unsigned i= nt new_cpu) > */ > WARN_ON_ONCE(!cpu_online(new_cpu)); > =20 > + /* A task of another class would leave its bandwidth in this_bw. */ > + WARN_ON_ONCE(!dl_task(p) && p->dl.dl_bw_oncpu); [Severity: Medium] Does this unconditionally load a cold cacheline in p->dl on every non-deadline task migration? set_task_cpu() runs on hot paths such as try_to_wake_up() and detach_task(), under p->pi_lock or rq->__lock with IRQs disabled. Non-deadline paths do not otherwise touch p->dl, so reading dl_bw_oncpu adds a cold cacheline load on every migration even without deadline tasks. Checking here also only fires belatedly on an unrelated migration trace, misses tasks that stay on one CPU, and is compiled out without CONFIG_SMP. Checking WARN_ON_ONCE(p->dl.dl_bw_oncpu) in switched_from_dl(), where p->dl is already hot in cache, or gating this check behind CONFIG_SCHED_DEBUG would avoid penalizing non-deadline migrations while catching class-exit leaks at the source. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/cover.1796296313.gi= t.mathieu.desnoyers@efficios.com?part=3D37