Re: [PATCH RFC] arm64: Mark set_preempt_need_resched() access to .need_resched
From: Marco Elver
Date: Fri Aug 07 2026 - 09:51:42 EST
On Fri, Aug 07, 2026 at 02:19PM +0100, Will Deacon wrote:
[...]
> Ok, but then I don't understand how these accesses can race. They appear
> to be on the same CPU, in the same IPI handler.
The only way this could happen is with an NMI, but that's not the case
here? I should have looked at the 2nd stack trace, and it seems to be
clear that this is a false positive: KCSAN sets up a watchpoint on an
address that is also accessed by __delay.
One problem with disabling KCSAN in this CPU's context is that we'd fail
to detect data races from nested interrupts.
So yes, the best way forward is to disable KCSAN in the delay
implementation. And I recall doing this for x86, which has this:
[arch/x86/lib/Makefile]
...
# KCSAN uses udelay for introducing watchpoint delay; avoid recursion.
KCSAN_SANITIZE_delay.o := n
So let's do this for arm64, too. Sorry for the noise.
------ >8 ------