]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/watchdog: read TB close to where it is used
authorNicholas Piggin <npiggin@gmail.com>
Wed, 10 Nov 2021 02:50:56 +0000 (12:50 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 25 Nov 2021 00:25:34 +0000 (11:25 +1100)
commit3a5b2ec98a6c9e81b0d1b5e01587975129f144d4
tree4ac3efdd608cf7f5e6599f88adc142d1e029e732
parent6294622a7e1a3eb474e3e8f383f6a81a5e29444c
powerpc/watchdog: read TB close to where it is used

When taking watchdog actions, printing messages, comparing and
re-setting wd_smp_last_reset_tb, etc., read TB close to the point of use
and under wd_smp_lock or printing lock (if applicable).

This should keep timebase mostly monotonic with kernel log messages, and
could prevent (in theory) a laggy CPU updating wd_smp_last_reset_tb to
something a long way in the past, and causing other CPUs to appear to be
stuck.

These additional TB reads are all slowpath (lockup has been detected),
so performance does not matter.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Laurent Dufour <ldufour@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20211110025056.2084347-5-npiggin@gmail.com
arch/powerpc/kernel/watchdog.c