Re: [PATCH v2 2/2] timers/nohz: Mark got_idle_tick accesses as same-CPU races

From: Frederic Weisbecker

Date: Mon Oct 05 2026 - 11:01:07 EST


Le Fri, Oct 02, 2026 at 11:17:56PM +0800, Kunwu Chan a écrit :
> got_idle_tick is a per-CPU flag set by the tick interrupt handler in
> tick_sched_do_timer() and read and cleared by the idle path in
> tick_nohz_idle_got_tick(). The flag is intentionally accessed without
> ordering or locking; a concurrent set can be overwritten by the clear.
>
> Use WRITE_ONCE_THIS_CPU() and READ_ONCE_THIS_CPU() to identify these
> as intentional races between execution contexts on the same CPU,
> rather than accesses that may race across CPUs.
>
> Suggested-by: Thomas Gleixner <tglx@xxxxxxxxxx>
> Signed-off-by: Kunwu Chan <kunwu.chan@xxxxxxxxx>

Reviewed-by: Frederic Weisbecker <frederic@xxxxxxxxxx>

--
Frederic Weisbecker
SUSE Labs