]> 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)
commite080b1a96c9249bd08e7dde5e0f72386069614d9
tree4ac3efdd608cf7f5e6599f88adc142d1e029e732
parent015ec4a812e76f95c5cf4ea1b432af6a522bf660
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