Re: [PATCH v33 3/7] sched/core: Activate blocked donor when no owner is found

From: K Prateek Nayak

Date: Sun Oct 25 2026 - 23:02:38 EST


Hello Andrea,

On 10/24/2026 2:03 PM, Andrea Righi 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?

You are right! I guess we should consolidate all the "return p" bits
to jump to the sched_cpu_cookie_match() check.

--
Thanks and Regards,
Prateek