Re: [PATCH v24 08/11] sched: Avoid donor->sched_class->yield_task() null traversal

From: K Prateek Nayak

Date: Tue Dec 30 2025 - 01:01:58 EST


Hello John,

On 11/25/2025 4:01 AM, John Stultz wrote:
> With proxy-exec once we do return migration from ttwu(), if a
> task is proxying for a waiting donor, and the donor is woken up,
> we switch the rq->donor to point to idle briefly until we can
> re-enter __schedule().
>
> However, if a task that was acting as a proxy calls into
> yield() right after the donor is switched to idle, it may
> trip a null pointer traversal, because the idle task doesn't
> have a yield_task() pointer.

I thought that was a transient state that should not be observed by the
running task.

Since NEED_RESCHED is retained, we'll just go though another pass of
__schedule() loop and the task should not observe rq->donor as idle in
do_sched_yield() as only the current task can yield on the local CPU.

Do we have a splat that suggests this happens?

--
Thanks and Regards,
Prateek