Re: [PATCH v33 3/7] sched/core: Activate blocked donor when no owner is found
From: John Stultz
Date: Wed Nov 25 2026 - 17:35:57 EST
On Sat, Oct 24, 2026 at 1:33 AM Andrea Righi <arighi@xxxxxxxxxx> wrote:
> On Fri, Oct 23, 2026 at 10:04:14PM +0000, John Stultz wrote:
> > @@ -7013,11 +7026,11 @@ find_proxy_task(struct rq *rq, struct task_struct *donor, struct rq_flags *rf)
> > struct mutex *mutex = p->blocked_on;
> > if (!mutex) {
> > clear_task_blocked_on(p, mutex);
> > - if (task_current(rq, p)) {
> > + if (task_current(rq, p) || p->wake_cpu == task_cpu(p)) {
> > p->is_blocked = 0;
> > return p;
> > }
> > - goto deactivate;
> > + goto activate;
> > }
>
> IIUC, p here isn't necessarily the donor, after the first iteration it
> can be an intermediate owner that is queued on this rq and blocked
> itself. If its blocked_on was cleared by a handoff (or its mutex has no
> owner, below), we now return it when p->wake_cpu == task_cpu(p),
> skipping the sched_cpu_cookie_match() check at the end of the function.
>
> So with CONFIG_SCHED_CORE enabled, are we running a task that was never
> cookie-checked by the core-wide pick?
Thanks for reviewing and raising this! (Sorry for the slow response)
Yeah. Looking at this more, I'm thinking we should just drop the early
return conditional and just always call goto activate, as the shortcut
potentially skips maybe too much logic, and duplicating it all will
just get messy.
thanks
-john