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=1796311742; b=QVvdYwyAVIgVU7ZXxZIV7lHU6ZRCCuwaafQxLngCxQ3PhKFZFSOlSQVCapXqYgO7NybH lsi5I0PxOcSNyA+seoaR8LMUjjjYVf8fXezQOtzXuKwTTB2N5bNHIq++BBngRqJ7OWY6i 5qo3YTLOwcuxilODkEYHItCjJ4V4qiPVTtoHEjwWq0XuDgEIkwZJjV6GSvMi9FlzATmIq KjJjkqrSZ/lbuVkDlvPON6fhGOfCiuU1IbkVN9L/VRnydlgsR4sw0dyuUQfiMYWwna7xM 5ciCVU+3wXqfUYl3EPjMHMBU2KFXco5i7cGgG37BMC6mauywRY0hBMNgWngeTeCwgBg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796311742; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=Uh6hBK9+WeVsBYrSgnb4fBDdwXU9EaIRcujdlD2Y3dU=; b=yEjppVk/n+4PdYdw4jVjoHgjECXK3KBX76OLqTGxf6cXWnukvgklHl7LedcSyrY9u/ve FNzgc+Ov1PSYPNTXH5Ns2dNdO3C57efny7hKNAGkO1jdItd1aZOh3QddOVnR1eyXc0s/7 m4rrtk0ew2IQAXFfjLnfHoWtKqcailx7JyGDMdjInW/H5aq+QeTuvITZ9wP649vSxCEir nTzz3Vz0VAeXPdzbV2+Qe7BZQ2pDRAnEZTLYVRgCXhgpDFexUoMpL4Z4cPgqpvNgo+aGW 7cE4cFAePu/2H29NmsnmBLqNQ/WeKSaiTe64O+HnG+PKgNHPNW3vzOcf1cfpN/L+1iA== 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=BBBaypL6; 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 14CF3606A32C; Thu, 3 Dec 2026 15:29:01 +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=BBBaypL6 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7799D1F00898; Thu, 3 Dec 2026 15:29:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796311741; bh=Uh6hBK9+WeVsBYrSgnb4fBDdwXU9EaIRcujdlD2Y3dU=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=BBBaypL64kZ4hFEJMvCWrqdSUO7Qrdhn1Nsiaop7eSMOEBwYGpUItjrYod05yJLhj GvcONyM/XkBPTCDnAT4GdzhJ9tm7uVtw8Ul6rSXkF3kuKYC2LNG7FrucM/KOayLtjG lb/BNOAWCz4pqMWZEbU9wyF4PWCZSEhb3ZgGch7qWRaoChp7wZGZy4vDRbM0CvgYw0 03g4s82U0ZkrBk7Q0hUuTtDvgoZwKWTgx7+aYIZODrt/MuD2rPHbwevDk8LxrmS3YM w8+XnB5TuwL527By2Ac5pPpX1LOAChTj8lfmyYc9kXI3rSY9Rz/5vP4hcro4pgwc6j 1qbGIHO8RjjVw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v14 02/39] sched/deadline: Replenish a throttled task boosted while asleep 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: <820b6a522c53eef14d41b0893f72e090ad8da92e.1796296313.git.mathieu.desnoyers@efficios.com> References: <820b6a522c53eef14d41b0893f72e090ad8da92e.1796296313.git.mathieu.desnoyers@efficios.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 15:29:01 +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: - [Low] sched/deadline: Fixes trailer cites feff2e65efd8 instead of aee38ea95419 -- commit 43888afc681de375614e3f79133646abba848ae0 Author: Mathieu Desnoyers > sched/deadline: Replenish a throttled task boosted while asleep > > A deadline task can be throttled as it blocks, with an rt_mutex held. > Its replenishment timer is then armed. A deadline waiter can boost the > task while it sleeps. > > Commit feff2e65efd8 ("sched/deadline: Unthrottle PI boosted threads > while enqueuing") lets a boost override the throttle. enqueue_task_dl() > lifts the throttle of a boosted task, and dl_task_timer() ignores a > boosted task. This covers a task that is enqueued while boosted. But a > boost of a sleeping task does not enqueue it. > > T is a SCHED_DEADLINE task that holds the rt_mutex L. W is a > SCHED_DEADLINE task with an earlier deadline: > > T W T's t= imer > > uses up its runtime, sleeps > dl_throttled =3D 1 > start_dl_timer() > pthread_mutex_timedlock(L) > rt_mutex_setprio(T, W) > T sleeps: no enqueue > dl_ta= sk_timer() > T i= s boosted: returns > times out > rt_mutex_setprio(T, NULL) > wakes up > enqueue_dl_entity() > dl_throttled: waits for the timer > > The timer has already fired. T would never run again, not even to die > of SIGKILL. Every later waiter on L would hang too. This was found by > reading. > > Fix this by returning early in dl_task_timer() only for a boosted task > that is queued. A boosted task that sleeps then takes the existing path > for a throttled task that is not queued: it is replenished. > > The timer refills the task from the parameters of its donor. After the > deboost, the task keeps the runtime and the deadline of that refill. > Its wakeup then checks them against its own parameters, as any wakeup > does. On v7.4-rc2, a queued boosted task also keeps the values of its > donor after the deboost. The priority inheritance series gives the > task its own values back. > > The refill relies on two earlier patches: > - "sched/deadline: Hold a reference on the deadline donor of a boosted > task" is earlier in this series. It keeps the donor from being freed > while the task points to it. A chain walk that has not reached the > task yet leaves it on an old donor. The refill then uses the > parameters of that old donor, as for a queued boosted task. > - "sched/deadline: Do not replenish a boost from cleared parameters" is > in the first series. It keeps the refill from looping on the > parameters of a donor that left the class. > > The Sashiko AI review of this series found this. > > Fixes: feff2e65efd8 ("sched/deadline: Unthrottle PI boosted threads while= enqueuing") > Signed-off-by: Mathieu Desnoyers > Reviewed-by: Juri Lelli > Cc: stable@vger.kernel.org [Severity: Low] Should the Fixes tag cite aee38ea95419 ("sched/deadline: Fix races between rt_mutex_setprio() and dl_task_timer()") instead of feff2e65efd8 ("sched/deadline: Unthrottle PI boosted threads while enqueuing")? That commit only changed enqueue_task_dl() and did not touch dl_task_timer(). The unconditional boosted early return in dl_task_timer() was already present from the earlier commit, so this hang existed before the enqueue_task_dl() change. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/cover.1796296313.gi= t.mathieu.desnoyers@efficios.com?part=3D2