All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tick-common: touch watchdog for every cpus when system resume
@ 2020-01-10  8:39 Chunyan Zhang
  2020-01-15 20:53 ` [tip: timers/core] tick/common: Touch watchdog in tick_unfreeze() on all CPUs tip-bot2 for Chunyan Zhang
  0 siblings, 1 reply; 2+ messages in thread
From: Chunyan Zhang @ 2020-01-10  8:39 UTC (permalink / raw)
  To: Frederic Weisbecker, Thomas Gleixner, Ingo Molnar
  Cc: linux-kernel, Chunyan Zhang, Chunyan Zhang

In the function tick_unfreeze(), it would resume timekeeping for the
first cpu, and for other cpus it does local tick resume only, not
to touch watchdog which is per-cpu as well.

This probably is not the problem for suspend to ram, but for suspend
to idle is. Since watchdog would be setup for each unplugged cores when
plugging during resume and would be touched in its setup process. But for
suspend to idle the system wouldn't unplug/plug cores, so we should
touch watchdog once resume from s2idle to avoid 'soft lockup' warnings
due to timeout detected by watchdog.

Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
---
 kernel/time/tick-common.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c
index 59225b484e4e..7e5d3524e924 100644
--- a/kernel/time/tick-common.c
+++ b/kernel/time/tick-common.c
@@ -11,6 +11,7 @@
 #include <linux/err.h>
 #include <linux/hrtimer.h>
 #include <linux/interrupt.h>
+#include <linux/nmi.h>
 #include <linux/percpu.h>
 #include <linux/profile.h>
 #include <linux/sched.h>
@@ -558,6 +559,7 @@ void tick_unfreeze(void)
 		trace_suspend_resume(TPS("timekeeping_freeze"),
 				     smp_processor_id(), false);
 	} else {
+		touch_softlockup_watchdog();
 		tick_resume_local();
 	}
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [tip: timers/core] tick/common: Touch watchdog in tick_unfreeze() on all CPUs
  2020-01-10  8:39 [PATCH] tick-common: touch watchdog for every cpus when system resume Chunyan Zhang
@ 2020-01-15 20:53 ` tip-bot2 for Chunyan Zhang
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot2 for Chunyan Zhang @ 2020-01-15 20:53 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Chunyan Zhang, Thomas Gleixner, x86, LKML

The following commit has been merged into the timers/core branch of tip:

Commit-ID:     5167c506d62dd9ffab73eba23c79b0a8845c9fe1
Gitweb:        https://git.kernel.org/tip/5167c506d62dd9ffab73eba23c79b0a8845c9fe1
Author:        Chunyan Zhang <zhang.lyra@gmail.com>
AuthorDate:    Fri, 10 Jan 2020 16:39:02 +08:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Wed, 15 Jan 2020 21:29:45 +01:00

tick/common: Touch watchdog in tick_unfreeze() on all CPUs

Suspend to IDLE invokes tick_unfreeze() on resume. tick_unfreeze() on the
first resuming CPU resumes timekeeping, which also has the side effect of
resetting the softlockup watchdog on this CPU.

But on the secondary CPUs the watchdog is not reset in the resume /
unfreeze() path, which can result in false softlockup warnings on those
CPUs depending on the time spent in suspend.

Prevent this by clearing the softlock watchdog in the unfreeze path also
on the secondary resuming CPUs.

[ tglx: Massaged changelog ]

Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20200110083902.27276-1-chunyan.zhang@unisoc.com
---
 kernel/time/tick-common.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c
index 59225b4..7e5d352 100644
--- a/kernel/time/tick-common.c
+++ b/kernel/time/tick-common.c
@@ -11,6 +11,7 @@
 #include <linux/err.h>
 #include <linux/hrtimer.h>
 #include <linux/interrupt.h>
+#include <linux/nmi.h>
 #include <linux/percpu.h>
 #include <linux/profile.h>
 #include <linux/sched.h>
@@ -558,6 +559,7 @@ void tick_unfreeze(void)
 		trace_suspend_resume(TPS("timekeeping_freeze"),
 				     smp_processor_id(), false);
 	} else {
+		touch_softlockup_watchdog();
 		tick_resume_local();
 	}
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-15 20:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-10  8:39 [PATCH] tick-common: touch watchdog for every cpus when system resume Chunyan Zhang
2020-01-15 20:53 ` [tip: timers/core] tick/common: Touch watchdog in tick_unfreeze() on all CPUs tip-bot2 for Chunyan Zhang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.