Re: [PATCH] sched_ext: Fix lock imbalance in dispatch_to_local_dsq()

From: Changwoo Min
Date: Thu Jan 23 2025 - 21:21:55 EST


Hello Andrea,

On 25. 1. 24. 08:42, Andrea Righi wrote:
kernel/sched/ext.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index a24d48cebfb7..7500b1a26757 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -2617,6 +2617,8 @@ static void dispatch_to_local_dsq(struct rq *rq, struct scx_dispatch_q *dst_dsq,
/* if the destination CPU is idle, wake it up */
if (sched_class_above(p->sched_class, dst_rq->curr->sched_class))
resched_curr(dst_rq);
+ } else {
+ dst_rq = src_rq;
}

The fix makes sense to me. Since this is a very specific and
tricky case, it will be better to include detailed comments in
the else part so anyone can easily understand why the else part
is necessary.

Regards,
Changwoo Min