From: "tip-bot2 for Andrea Righi" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Andrea Righi <arighi@nvidia.com>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
K Prateek Nayak <kprateek.nayak@amd.com>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: sched/core] sched/core: Drop mutex locks before proxy rescheduling
Date: Mon, 28 Sep 2026 07:01:40 -0000 [thread overview]
Message-ID: <179057890072.3910103.566976227943604547.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20260922165445.943315-2-arighi@nvidia.com>
The following commit has been merged into the sched/core branch of tip:
Commit-ID: 313b652837d0541684680a7d07a95c5560441d4f
Gitweb: https://git.kernel.org/tip/313b652837d0541684680a7d07a95c5560441d4f
Author: Andrea Righi <arighi@nvidia.com>
AuthorDate: Tue, 22 Sep 2026 18:51:40 +02:00
Committer: Peter Zijlstra <peterz@infradead.org>
CommitterDate: Mon, 28 Sep 2026 08:44:38 +02:00
sched/core: Drop mutex locks before proxy rescheduling
find_proxy_task() can call proxy_resched_idle() from return
expressions inside mutex wait_lock and blocked task lock guard scopes.
Return expressions are evaluated before scoped guards are released, so
proxy_resched_idle() invokes scheduling-class callbacks while both raw
spinlocks are held.
Route these cases through a common label outside the guard scopes. The
common label is required because a direct return would evaluate
proxy_resched_idle() before guard cleanup and run the class callbacks
under the proxy-exec locks again.
This is a preparatory change to support proxy execution with sched_ext.
Signed-off-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: K Prateek Nayak <kprateek.nayak@amd.com>
Link: https://patch.msgid.link/20260922165445.943315-2-arighi@nvidia.com
---
kernel/sched/core.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index ee9b443..f34e73c 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6980,7 +6980,7 @@ find_proxy_task(struct rq *rq, struct task_struct *donor, struct rq_flags *rf)
if (!READ_ONCE(owner->on_rq) || owner->se.sched_delayed) {
/* XXX Don't handle blocked owners/delayed dequeue yet */
if (curr_in_chain)
- return proxy_resched_idle(rq);
+ goto resched_idle;
__clear_task_blocked_on(p, NULL);
goto deactivate;
}
@@ -6992,7 +6992,7 @@ find_proxy_task(struct rq *rq, struct task_struct *donor, struct rq_flags *rf)
* and leave that CPU to sort things out.
*/
if (curr_in_chain)
- return proxy_resched_idle(rq);
+ goto resched_idle;
goto migrate_task;
}
@@ -7005,7 +7005,7 @@ find_proxy_task(struct rq *rq, struct task_struct *donor, struct rq_flags *rf)
* case we should end up back in find_proxy_task(), this time
* hopefully with all relevant tasks already enqueued.
*/
- return proxy_resched_idle(rq);
+ goto resched_idle;
}
/*
@@ -7042,7 +7042,7 @@ find_proxy_task(struct rq *rq, struct task_struct *donor, struct rq_flags *rf)
* So schedule rq->idle so that ttwu_runnable() can get the rq
* lock and mark owner as running.
*/
- return proxy_resched_idle(rq);
+ goto resched_idle;
}
/*
* OK, now we're absolutely sure @owner is on this
@@ -7062,6 +7062,8 @@ find_proxy_task(struct rq *rq, struct task_struct *donor, struct rq_flags *rf)
}
return owner;
+resched_idle:
+ return proxy_resched_idle(rq);
deactivate:
proxy_deactivate(rq, p);
return NULL;
next prev parent reply other threads:[~2026-09-28 7:01 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-22 16:51 [PATCHSET v14 sched_ext/for-7.4] sched: Make proxy execution compatible with sched_ext Andrea Righi
2026-09-22 16:51 ` [PATCH 01/16] sched/core: Drop mutex locks before proxy rescheduling Andrea Righi
2026-09-28 7:01 ` tip-bot2 for Andrea Righi [this message]
2026-09-22 16:51 ` [PATCH 02/16] sched/core: Dequeue waking proxy donors before reset Andrea Righi
2026-09-28 7:01 ` [tip: sched/core] " tip-bot2 for Andrea Righi
2026-09-22 16:51 ` [PATCH 03/16] sched/core: Mark wakeups completed through ttwu_runnable() Andrea Righi
2026-09-28 7:01 ` [tip: sched/core] " tip-bot2 for Andrea Righi
2026-09-22 16:51 ` [PATCH 04/16] sched: Add helper to block retained proxy donors Andrea Righi
2026-09-28 7:01 ` [tip: sched/core] " tip-bot2 for Andrea Righi
2026-09-22 16:51 ` [PATCH 05/16] sched: Add sched_ext hooks for proxy execution Andrea Righi
2026-09-24 7:51 ` Peter Zijlstra
2026-09-25 8:23 ` Andrea Righi
2026-09-28 7:01 ` [tip: sched/core] " tip-bot2 for Andrea Righi
2026-09-22 16:51 ` [PATCH 06/16] sched_ext: Block proxy donors before taking control Andrea Righi
2026-09-22 16:51 ` [PATCH 07/16] sched_ext: Fix ops.running/stopping() pairing for proxy-exec donors Andrea Righi
2026-09-22 16:51 ` [PATCH 08/16] sched_ext: Move reject DSQ draining into core Andrea Righi
2026-09-22 16:51 ` [PATCH 09/16] sched_ext: Generalize the reject DSQ reenqueue path Andrea Righi
2026-09-22 16:51 ` [PATCH 10/16] sched_ext: Handle proxy-exec races in remote DSQ transfers Andrea Righi
2026-09-22 16:51 ` [PATCH 11/16] sched_ext: Split curr|donor references properly Andrea Righi
2026-09-22 16:51 ` [PATCH 12/16] sched_ext: Track proxy execution for NOHZ_FULL Andrea Righi
2026-09-22 16:51 ` [PATCH 13/16] sched_ext: Delegate proxy donor admission to BPF schedulers Andrea Righi
2026-09-22 16:51 ` [PATCH 14/16] sched_ext: Add selftest for blocked donor admission Andrea Righi
2026-09-22 16:51 ` [PATCH 15/16] sched_ext: scx_qmap: Add proxy execution support Andrea Righi
2026-09-22 16:51 ` [PATCH 16/16] sched: Allow enabling proxy exec with sched_ext Andrea Righi
2026-09-24 7:52 ` [PATCHSET v14 sched_ext/for-7.4] sched: Make proxy execution compatible " Peter Zijlstra
2026-09-24 7:59 ` Peter Zijlstra
2026-09-24 8:10 ` K Prateek Nayak
2026-09-24 9:09 ` Peter Zijlstra
2026-09-25 7:46 ` Andrea Righi
2026-09-25 7:56 ` Peter Zijlstra
2026-09-26 19:17 ` Tejun Heo
2026-09-28 19:53 ` Tejun Heo
2026-09-28 20:47 ` Andrea Righi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179057890072.3910103.566976227943604547.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=arighi@nvidia.com \
--cc=kprateek.nayak@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®