[PATCH linux-next] powerpc: use raw_smp_processor_id in arch_touch_nmi_watchdog

John Ogness john.ogness at linutronix.de
Thu Jul 14 21:46:37 AEST 2022


On 2022-07-14, Zhouyi Zhou <zhouzhouyi at gmail.com> wrote:
> Thank John for correcting me ;-)

After looking more closely, I do not think disabling migration is the
correct fix either.

The per-cpu variable @wd_timer_tb is written from 2 functions:

- watchdog_timer_interrupt() <-- irq handler
- arch_touch_nmi_watchdog()  <-- called from preemptible

Since watchdog_timer_interrupt() is called from irq context, I expect
that interrupts need to be disabled for the update in
arch_touch_nmi_watchdog(). Perhaps a using a per-cpu local_lock_t with
local_lock_irqsave() to protect write access to @wd_timer_tb?

John Ogness


More information about the Linuxppc-dev mailing list