Re: [PATCH] sched: Proxy yields to donor tasks

From: Peter Zijlstra

Date: Fri Nov 07 2025 - 03:25:45 EST


On Fri, Nov 07, 2025 at 10:12:53AM +0200, Fernand Sieber wrote:
> On Thu, Nov 07, 2025 at 02:31:16PM +0800, kernel test robot wrote:
> > sparse warnings: (new ones prefixed by >>)
> >
> >>> kernel/sched/rt.c:529:55: sparse: warning: incorrect type in initializer (different address spaces)
> >>> kernel/sched/rt.c:976:39: sparse: warning: incorrect type in initializer (different address spaces)
>
> Thank you for the report.
>
> The warnings occur because my patch changes scheduler yield functions from
> accessing rq->curr to rq->donor, both of which have identical __rcu annotations.
> These are pre-existing annotation issues in the scheduler code, which has been
> directly accessing RCU-annotated pointers without proper dereferencing, relying
> on runqueue lock protection instead.
>
> If we do want to address these sparse warnings, I can make modifications like:
>
> - curr = rq->donor;
> + curr = rcu_dereference_protected(rq->donor, lockdep_is_held(&rq->__lock));
>
> This would have zero runtime overhead while satisfying sparse's RCU checking.
>
> Peter, let me know if these warnings should be addressed.

Nah, I'm happy to ignore them to retain readable code :-)