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

From: Andrea Righi
Date: Fri Jan 24 2025 - 01:21:19 EST


On Fri, Jan 24, 2025 at 11:21:33AM +0900, Changwoo Min wrote:
> 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.

Good idea, I'll send a v2 including a comment in the else part.

Thanks!
-Andrea