Re: [PATCH v29 7/9] sched: Add blocked_donor link to task for smarter mutex handoffs

From: John Stultz

Date: Wed May 20 2026 - 17:19:50 EST


On Tue, May 19, 2026 at 8:47 AM K Prateek Nayak <kprateek.nayak@xxxxxxx> wrote:
> On 5/19/2026 8:02 PM, Peter Zijlstra wrote:
> > @@ -1063,7 +1071,8 @@ static noinline void __sched __mutex_unl
> > __mutex_handoff(lock, next);
> >
> > raw_spin_unlock(&current->blocked_lock);
> > - raw_spin_unlock_irqrestore_wake(&lock->wait_lock, flags, &wake_q);
> > + raw_spin_unlock_irqrestore(&lock->wait_lock, flags);
> > + wake_up_q(&wake_q);
>
> In that case, can't we simplify this to:
>
> if (next)
> wake_up_process(next);
>
> and save on the wake_q enqueue dequeue overheads?
>

Ah, good point. I'll add that cleanup as well to my tree and start
testing. Appreciate you pointing this out!

thanks
-john