From nobody Mon Jun 8 07:24:28 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 720B84C6F0D; Thu, 4 Jun 2026 18:45:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780598753; cv=none; b=bEFhT/2G7J/Tb2iDLgoCR5RrMntOccLQD6Eu/KvV4HPEJdxnFfOqx1m9e4okMBgexI3R+O6I1aDiM4l+mOt6C3hNw+ExWh7/u1B8onh8J7/K3E3BD+5rrI1IyYt7mumNJ4KpKvquddcmHCx7gZjfq/9nd4htn0/xdLxjcltlWQA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780598753; c=relaxed/simple; bh=P0j7xJXjJGTuXr6XdyNRd6rN0MCi7a1qfNeyAOCjoAo=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=M9nEItj0YUkoKUYVihpgIttWzSGqUGHbdB+eW6TUoaTFuIoLvgmGLJ/p9Lv+fZw6yXDOZnGq/uoiDMXV3p8YWsZnIItTgKHTRD/oWwAqZ/FGNkuKR/ydYFKe/jRsRHw2tSCF/9qanGhkyAQmo63TAqaLEVXhGyDA5PC0pkUQSh8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=If70AMeA; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=kyl+Ygww; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="If70AMeA"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="kyl+Ygww" Date: Thu, 04 Jun 2026 18:45:49 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1780598751; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sKEZGqr/UhtC8RrPewU2LpSe9CS4PXhg68OxfBHkFn0=; b=If70AMeA9Jx5LAohTlPsfe2/SrBWfWBjlDi1Ss11XIOm0WkXvgN2X7xCf+o3/SEHJ9L+VU 4Sv+fy5tS/UER+URGM+hyajcvzXcO06ldqgTwWtwY+i6k2Xq8sxNVzbbVDCwuwK+FFDOUk 7cUmI6H4yjMCtf1Ixt29893QWHM9VnKRJYHPHdtDXwMTgx3kw3PbH9FbFbUnZr71WHlxcl 4KOL/EuIVdA0jWgejGdKbCcbOoj5kwl7OBFDdgWYPA5/dpBl+rvoWK5wPkufBnEqg9+f4N QgRJQJpkMQ3Tio3gge12D3RjuvCCCl+X6FTMlNDmuXqR5X6JrNHECQzq4qXQ6A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1780598751; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sKEZGqr/UhtC8RrPewU2LpSe9CS4PXhg68OxfBHkFn0=; b=kyl+YgwwS5ZXiMdS5FiBMQXWzT+FkHMYFrDHJt7qvo8rSLFG9ccgrAt8MZ37Y1/xHbgVbs l+LF0n7ZovMb1yDQ== From: "tip-bot2 for John Stultz" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched: deadline: Add dl_rq->curr pointer to address issues with Proxy Exec Cc: Peter Zijlstra , John Stultz , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260512025635.2840817-4-jstultz@google.com> References: <20260512025635.2840817-4-jstultz@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <178059874975.710.2859158188168218703.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the sched/core branch of tip: Commit-ID: cd8e62c85861bcfbbefedce11a6f8eb00c774312 Gitweb: https://git.kernel.org/tip/cd8e62c85861bcfbbefedce11a6f8eb00= c774312 Author: John Stultz AuthorDate: Tue, 12 May 2026 02:56:13=20 Committer: Peter Zijlstra CommitterDate: Tue, 02 Jun 2026 12:26:06 +02:00 sched: deadline: Add dl_rq->curr pointer to address issues with Proxy Exec The DL scheduler keeps the current task in the rbtree, since the deadline value isn't usually chagned while the task is runnable. This results in set_next_task() and put_prev_task() being simpler, but unfortunately this causes complexity elsewhere. Specifically when update_curr_dl() updates the deadline, it has to dequeue and then enqueue the task. >From put_prev_task_dl(), we first call update_curr_dl(), and then call enqueue_pushable_dl_task(). However, with Proxy Exec this goes awry. Since when a mutex is released, we might wake the waiting rq->donor. This will cause put_prev_task() to be called on the donor to take it off the cpu for return migration. At that point, from put_prev_task_dl() the update_curr_dl() logic will dequeue & enqueue the task, and the enqueue function will call enqueue_pushable_dl_task() (since the task_current() check won't prevent it). Then back up the callstack in put_prev_task_dl() we'll end up calling enqueue_pushable_dl_task() again, tripping the !RB_EMPTY_NODE(&p->pushable_dl_tasks) warning. So to avoid this, use Peter's suggested[1] approach, and add a dl_rq->curr pointer that is set/cleared from set_next_task()/ put_prev_task(), which effectively tracks the rq->donor. We can then use this to avoid adding the active donor to the pushable list from enqueue_task_dl(). [1]: https://lore.kernel.org/lkml/20260304095123.GP606826@noisy.programming= .kicks-ass.net/ Suggested-by: Peter Zijlstra Signed-off-by: John Stultz Signed-off-by: Peter Zijlstra (Intel) Link: https://patch.msgid.link/20260512025635.2840817-4-jstultz@google.com --- kernel/sched/deadline.c | 13 +++++++++++++ kernel/sched/sched.h | 1 + 2 files changed, 14 insertions(+) diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index 0b7ac4c..4754dbe 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c @@ -2541,6 +2541,9 @@ static void enqueue_task_dl(struct rq *rq, struct tas= k_struct *p, int flags) if (task_is_blocked(p)) return; =20 + if (dl_rq->curr =3D=3D dl_se) + return; + if (!task_current(rq, p) && !dl_se->dl_throttled && p->nr_cpus_allowed > = 1) enqueue_pushable_dl_task(rq, p); } @@ -2763,6 +2766,10 @@ static void start_hrtick_dl(struct rq *rq, struct sc= hed_dl_entity *dl_se) } #endif /* !CONFIG_SCHED_HRTICK */ =20 +/* + * DL keeps current in tree, because ->deadline is not typically changed w= hile + * a task is runnable. + */ static void set_next_task_dl(struct rq *rq, struct task_struct *p, bool fi= rst) { struct sched_dl_entity *dl_se =3D &p->dl; @@ -2775,6 +2782,9 @@ static void set_next_task_dl(struct rq *rq, struct ta= sk_struct *p, bool first) /* You can't push away the running task */ dequeue_pushable_dl_task(rq, p); =20 + WARN_ON_ONCE(dl_rq->curr); + dl_rq->curr =3D dl_se; + if (!first) return; =20 @@ -2845,6 +2855,9 @@ static void put_prev_task_dl(struct rq *rq, struct ta= sk_struct *p, struct task_s =20 update_dl_rq_load_avg(rq_clock_pelt(rq), rq, 1); =20 + WARN_ON_ONCE(dl_rq->curr !=3D dl_se); + dl_rq->curr =3D NULL; + if (task_is_blocked(p)) return; =20 diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index ef715f2..b3aff26 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -893,6 +893,7 @@ struct dl_rq { =20 bool overloaded; =20 + struct sched_dl_entity *curr; /* * Tasks on this rq that can be pushed away. They are kept in * an rb-tree, ordered by tasks' deadlines, with caching