From: Nicholas Piggin <npiggin@gmail.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: Nicholas Piggin <npiggin@gmail.com>
Subject: [PATCH 3/5] powerpc/watchdog: do not trigger SMP crash from touch_nmi_watchdog
Date: Mon, 18 Sep 2017 18:27:04 +1000 [thread overview]
Message-ID: <20170918082706.6485-4-npiggin@gmail.com> (raw)
In-Reply-To: <20170918082706.6485-1-npiggin@gmail.com>
In xmon, touch_nmi_watchdog() is not expected to be checking that
other CPUs have not touched the watchdog, so the code will just
call touch_nmi_watchdog() once before re-enabling hard interrupts.
Just update our CPU's state, and ignore apparently stuck SMP threads.
Arguably touch_nmi_watchdog should check for SMP lockups, and
callers should be fixed, but that's not trivial for the input code
of xmon.
---
arch/powerpc/kernel/watchdog.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/watchdog.c b/arch/powerpc/kernel/watchdog.c
index 920e61c79f47..1fb9379dc683 100644
--- a/arch/powerpc/kernel/watchdog.c
+++ b/arch/powerpc/kernel/watchdog.c
@@ -277,9 +277,12 @@ void arch_touch_nmi_watchdog(void)
{
unsigned long ticks = tb_ticks_per_usec * wd_timer_period_ms * 1000;
int cpu = smp_processor_id();
+ u64 tb = get_tb();
- if (get_tb() - per_cpu(wd_timer_tb, cpu) >= ticks)
- watchdog_timer_interrupt(cpu);
+ if (tb - per_cpu(wd_timer_tb, cpu) >= ticks) {
+ per_cpu(wd_timer_tb, cpu) = tb;
+ wd_smp_clear_cpu_pending(cpu, tb);
+ }
}
EXPORT_SYMBOL(arch_touch_nmi_watchdog);
--
2.13.3
next prev parent reply other threads:[~2017-09-18 8:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-18 8:27 [PATCH 0/5] More NMI IPI enablement work Nicholas Piggin
2017-09-18 8:27 ` [PATCH 1/5] powerpc/watchdog: do not panic from locked CPU's IPI handler Nicholas Piggin
2017-09-18 8:27 ` [PATCH 2/5] powerpc/watchdog: do not backtrace locked CPUs twice if allcpus backtrace is enabled Nicholas Piggin
2017-09-18 8:27 ` Nicholas Piggin [this message]
2017-09-18 8:27 ` [PATCH 4/5] powerpc/xmon: avoid tripping SMP hardlockup watchdog Nicholas Piggin
2017-09-18 8:27 ` [PATCH 5/5] powerpc/powernv: implement NMI IPI with OPAL_SIGNAL_SYSTEM_RESET Nicholas Piggin
2017-09-21 11:10 ` [PATCH 0/5] More NMI IPI enablement work Michael Ellerman
2017-09-21 12:33 ` Nicholas Piggin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170918082706.6485-4-npiggin@gmail.com \
--to=npiggin@gmail.com \
--cc=linuxppc-dev@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).