summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Stultz <jstultz@google.com>2026-05-15 02:47:17 +0300
committerPeter Zijlstra <peterz@infradead.org>2026-05-19 13:17:39 +0300
commit04f80f8b12a02fa2e0827c8f37eb357adca8ce44 (patch)
tree8e40be4f3cdf89f96cd5758f08375cb646ba713f
parent61ea17a63719bac51e1bc50eb39fc637f0fdc06e (diff)
downloadlinux-04f80f8b12a02fa2e0827c8f37eb357adca8ce44.tar.xz
sched: Switch rq->next_class on proxy_resched_idle()
K Prateek noticed we weren't setting the rq->next_class in proxy_resched_idle(), when I was debugging an issue seen with CONFIG_SCHED_PROXY_EXEC and some of Peter's new patches, and suggested this fix. So set rq->next_class when we temporarily switch the donor to idle, so we don't accidentally call wakeup_preempt_fair() with idle as the donor. Suggested-by: K Prateek Nayak <kprateek.nayak@amd.com> Signed-off-by: John Stultz <jstultz@google.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://patch.msgid.link/20260514234732.3170197-1-jstultz@google.com
-rw-r--r--kernel/sched/core.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 3ae5f19c1b7e..77f4ebe8f5c7 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6653,6 +6653,7 @@ static inline void proxy_set_task_cpu(struct task_struct *p, int cpu)
static inline struct task_struct *proxy_resched_idle(struct rq *rq)
{
put_prev_set_next_task(rq, rq->donor, rq->idle);
+ rq->next_class = &idle_sched_class;
rq_set_donor(rq, rq->idle);
set_tsk_need_resched(rq->idle);
return rq->idle;