Re: [PATCH] sched,workqueue: Use READ_ONCE()/WRITE_ONCE() for wake_cpu accesses

From: Peter Zijlstra

Date: Fri Mar 27 2026 - 05:30:14 EST


On Fri, Mar 27, 2026 at 03:30:07PM +0800, Yu Peng wrote:
> task_struct->wake_cpu is used as a wake placement hint by scheduler code
> and workqueue's non-strict affinity repatriation path.
>
> These accesses are intentionally lockless and stale values are tolerated,
> affecting only wakeup placement.

The scheduler usage isn't lockless. And I'm not at all sure why and how
workqueue is poking at this stuff :/ It has no business poking at it.