linux-parisc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch V2 03/29] lockup_detector: Provide interface to stop from poweroff()
       [not found] <20170912193654.321505854@linutronix.de>
@ 2017-09-12 19:36 ` Thomas Gleixner
  2017-09-12 19:36 ` [patch V2 04/29] parisc: Use lockup_detector_stop() Thomas Gleixner
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Gleixner @ 2017-09-12 19:36 UTC (permalink / raw)
  To: LKML
  Cc: Ingo Molnar, Peter Zijlstra, Borislav Petkov, Andrew Morton,
	Sebastian Siewior, Nicholas Piggin, Don Zickus, Chris Metcalf,
	Ulrich Obergfell, linux-parisc, Helge Deller

PARISC has a a busy looping power off routine. If the watchdog is enabled
the watchdog timer will still fire, but the thread is not running, which
causes the softlockup watchdog to trigger.

Provide a interface which allows to turn the watchdog off.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Chris Metcalf <cmetcalf@mellanox.com>
Cc: linux-parisc@vger.kernel.org
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sebastian Siewior <bigeasy@linutronix.de>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Ulrich Obergfell <uobergfe@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Helge Deller <deller@gmx.de>
Link: http://lkml.kernel.org/r/20170831073053.202164272@linutronix.de

---
 include/linux/nmi.h |    6 +++---
 kernel/watchdog.c   |   14 +++++++++++++-
 2 files changed, 16 insertions(+), 4 deletions(-)

--- a/include/linux/nmi.h
+++ b/include/linux/nmi.h
@@ -12,10 +12,10 @@
 
 #ifdef CONFIG_LOCKUP_DETECTOR
 void lockup_detector_init(void);
+void lockup_detector_soft_poweroff(void);
 #else
-static inline void lockup_detector_init(void)
-{
-}
+static inline void lockup_detector_init(void) { }
+static inline void lockup_detector_soft_poweroff(void) { }
 #endif
 
 #ifdef CONFIG_SOFTLOCKUP_DETECTOR
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -333,7 +333,8 @@ static enum hrtimer_restart watchdog_tim
 	int duration;
 	int softlockup_all_cpu_backtrace = sysctl_softlockup_all_cpu_backtrace;
 
-	if (atomic_read(&watchdog_park_in_progress) != 0)
+	if (!watchdog_enabled ||
+	    atomic_read(&watchdog_park_in_progress) != 0)
 		return HRTIMER_NORESTART;
 
 	/* kick the hardlockup detector */
@@ -660,6 +661,17 @@ static void set_sample_period(void)
 }
 #endif /* SOFTLOCKUP */
 
+/**
+ * lockup_detector_soft_poweroff - Interface to stop lockup detector(s)
+ *
+ * Special interface for parisc. It prevents lockup detector warnings from
+ * the default pm_poweroff() function which busy loops forever.
+ */
+void lockup_detector_soft_poweroff(void)
+{
+	watchdog_enabled = 0;
+}
+
 /*
  * Suspend the hard and soft lockup detector by parking the watchdog threads.
  */

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

* [patch V2 04/29] parisc: Use lockup_detector_stop()
       [not found] <20170912193654.321505854@linutronix.de>
  2017-09-12 19:36 ` [patch V2 03/29] lockup_detector: Provide interface to stop from poweroff() Thomas Gleixner
@ 2017-09-12 19:36 ` Thomas Gleixner
  2017-09-14  8:59   ` Helge Deller
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas Gleixner @ 2017-09-12 19:36 UTC (permalink / raw)
  To: LKML
  Cc: Ingo Molnar, Peter Zijlstra, Borislav Petkov, Andrew Morton,
	Sebastian Siewior, Nicholas Piggin, Don Zickus, Chris Metcalf,
	Ulrich Obergfell, linux-parisc, Helge Deller

The broken lockup_detector_suspend/resume() interface is going away. Use
the new lockup_detector_soft_poweroff() interface to stop the watchdog from
the busy looping power off routine.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Chris Metcalf <cmetcalf@mellanox.com>
Cc: linux-parisc@vger.kernel.org
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sebastian Siewior <bigeasy@linutronix.de>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Ulrich Obergfell <uobergfe@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Helge Deller <deller@gmx.de>
Link: http://lkml.kernel.org/r/20170831073053.281414373@linutronix.de

---
 arch/parisc/kernel/process.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/parisc/kernel/process.c
+++ b/arch/parisc/kernel/process.c
@@ -146,7 +146,7 @@ void machine_power_off(void)
 
 	/* prevent soft lockup/stalled CPU messages for endless loop. */
 	rcu_sysrq_start();
-	lockup_detector_suspend();
+	lockup_detector_soft_poweroff();
 	for (;;);
 }
 

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

* Re: [patch V2 04/29] parisc: Use lockup_detector_stop()
  2017-09-12 19:36 ` [patch V2 04/29] parisc: Use lockup_detector_stop() Thomas Gleixner
@ 2017-09-14  8:59   ` Helge Deller
  2017-09-14 13:46     ` Don Zickus
  0 siblings, 1 reply; 4+ messages in thread
From: Helge Deller @ 2017-09-14  8:59 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: LKML, Ingo Molnar, Peter Zijlstra, Borislav Petkov,
	Andrew Morton, Sebastian Siewior, Nicholas Piggin, Don Zickus,
	Chris Metcalf, Ulrich Obergfell, linux-parisc, Helge Deller

* Thomas Gleixner <tglx@linutronix.de>:
> The broken lockup_detector_suspend/resume() interface is going away. Use
> the new lockup_detector_soft_poweroff() interface to stop the watchdog from
> the busy looping power off routine.
> 
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Cc: Don Zickus <dzickus@redhat.com>
> Cc: Chris Metcalf <cmetcalf@mellanox.com>
> Cc: linux-parisc@vger.kernel.org
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Sebastian Siewior <bigeasy@linutronix.de>
> Cc: Nicholas Piggin <npiggin@gmail.com>
> Cc: Ulrich Obergfell <uobergfe@redhat.com>
> Cc: Borislav Petkov <bp@alien8.de>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Helge Deller <deller@gmx.de>
> Link: http://lkml.kernel.org/r/20170831073053.281414373@linutronix.de
> 
> ---
>  arch/parisc/kernel/process.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- a/arch/parisc/kernel/process.c
> +++ b/arch/parisc/kernel/process.c
> @@ -146,7 +146,7 @@ void machine_power_off(void)
>  
>  	/* prevent soft lockup/stalled CPU messages for endless loop. */
>  	rcu_sysrq_start();
> -	lockup_detector_suspend();
> +	lockup_detector_soft_poweroff();
>  	for (;;);
>  }

Thomas, thanks for cleaning that up.  
You may add to patches 03/04:
Acked-by: Helge Deller <deller@gmx.de>


On a side-note, there is sadly no general function like
	turn_off_all_kind_of_runtime_hang_detectors()
which turns off *all* detectors at once (including soft lockup detector).
I've seen another detector complaing at runtime that we were hanging
here. I would need to dig up more info if you are interested...

Helge

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

* Re: [patch V2 04/29] parisc: Use lockup_detector_stop()
  2017-09-14  8:59   ` Helge Deller
@ 2017-09-14 13:46     ` Don Zickus
  0 siblings, 0 replies; 4+ messages in thread
From: Don Zickus @ 2017-09-14 13:46 UTC (permalink / raw)
  To: Helge Deller
  Cc: Thomas Gleixner, LKML, Ingo Molnar, Peter Zijlstra,
	Borislav Petkov, Andrew Morton, Sebastian Siewior,
	Nicholas Piggin, Chris Metcalf, Ulrich Obergfell, linux-parisc

On Thu, Sep 14, 2017 at 10:59:17AM +0200, Helge Deller wrote:
> * Thomas Gleixner <tglx@linutronix.de>:
> > The broken lockup_detector_suspend/resume() interface is going away. Use
> > the new lockup_detector_soft_poweroff() interface to stop the watchdog from
> > the busy looping power off routine.
> > 
> > Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> > Cc: Don Zickus <dzickus@redhat.com>
> > Cc: Chris Metcalf <cmetcalf@mellanox.com>
> > Cc: linux-parisc@vger.kernel.org
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Cc: Sebastian Siewior <bigeasy@linutronix.de>
> > Cc: Nicholas Piggin <npiggin@gmail.com>
> > Cc: Ulrich Obergfell <uobergfe@redhat.com>
> > Cc: Borislav Petkov <bp@alien8.de>
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > Cc: Helge Deller <deller@gmx.de>
> > Link: http://lkml.kernel.org/r/20170831073053.281414373@linutronix.de
> > 
> > ---
> >  arch/parisc/kernel/process.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > --- a/arch/parisc/kernel/process.c
> > +++ b/arch/parisc/kernel/process.c
> > @@ -146,7 +146,7 @@ void machine_power_off(void)
> >  
> >  	/* prevent soft lockup/stalled CPU messages for endless loop. */
> >  	rcu_sysrq_start();
> > -	lockup_detector_suspend();
> > +	lockup_detector_soft_poweroff();
> >  	for (;;);
> >  }
> 
> Thomas, thanks for cleaning that up.  
> You may add to patches 03/04:
> Acked-by: Helge Deller <deller@gmx.de>
> 
> 
> On a side-note, there is sadly no general function like
> 	turn_off_all_kind_of_runtime_hang_detectors()
> which turns off *all* detectors at once (including soft lockup detector).
> I've seen another detector complaing at runtime that we were hanging
> here. I would need to dig up more info if you are interested...

There are numerous detectors I have seen over the years: rcu, clocksource,
hard/soft, hang, fs, network, wq?, etc..  I am not sure it is easy to put
them all in one place or makes sense.

I know working with the kvm folks, when they swap back in, the real clock
can do a massive jump forward and causes a flood of warnings such that they
had to 'touch' all of them before running the vm again.

Cheers,
Don

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

end of thread, other threads:[~2017-09-14 13:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20170912193654.321505854@linutronix.de>
2017-09-12 19:36 ` [patch V2 03/29] lockup_detector: Provide interface to stop from poweroff() Thomas Gleixner
2017-09-12 19:36 ` [patch V2 04/29] parisc: Use lockup_detector_stop() Thomas Gleixner
2017-09-14  8:59   ` Helge Deller
2017-09-14 13:46     ` Don Zickus

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).