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

From: John Ogness
Date: Thu Jul 14 2022 - 07:46:43 EST


On 2022-07-14, Zhouyi Zhou <zhouzhouyi@xxxxxxxxx> 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