Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1323490 > unrolled thread

[PATCH v2 4/4] Add WARN() function call to hard-soft lockup

Started byJeffrey Merkey <jeffmerkey@gmail.com>
First post2016-02-01 21:50 +0100
Last post2016-02-01 22:20 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v2 4/4] Add WARN() function call to hard-soft lockup Jeffrey Merkey <jeffmerkey@gmail.com> - 2016-02-01 21:50 +0100
    Re: [PATCH v2 4/4] Add WARN() function call to hard-soft lockup Don Zickus <dzickus@redhat.com> - 2016-02-01 22:10 +0100
      Re: [PATCH v2 4/4] Add WARN() function call to hard-soft lockup Jeffrey Merkey <jeffmerkey@gmail.com> - 2016-02-01 22:20 +0100

#1323490 — [PATCH v2 4/4] Add WARN() function call to hard-soft lockup

FromJeffrey Merkey <jeffmerkey@gmail.com>
Date2016-02-01 21:50 +0100
Subject[PATCH v2 4/4] Add WARN() function call to hard-soft lockup
Message-ID<qXtA7-8mr-15@gated-at.bofh.it>
This patch series adds config options which can be set during compile to
direct the compiler to output a breakpoint instruction anywhere a BUG_XX()
or WARN_XX() macro has been placed in the kernel to trigger the system to
enter a debugger if a bug is detected by the system.  Use of this compile
time option also allows conditional breakpoints to be set in the kernel
where these macros have been previously placed.

This addition is extremely useful for debugging hard and soft lockups
real time and quickly from a console debugger, and other areas of the
kernel.

Signed-off-by: Jeffrey Merkey <jeffmerkey@gmail.com>
---
 kernel/watchdog.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index b3ace6e..af07a83 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -358,6 +358,8 @@ static void watchdog_overflow_callback(struct perf_event *event,
 		else
 			dump_stack();
 
+		WARN(1, "Watchdog detected hard LOCKUP on cpu %d", this_cpu);
+
 		/*
 		 * Perform all-CPU dump only once to avoid multiple hardlockups
 		 * generating interleaving traces
@@ -478,6 +480,9 @@ static enum hrtimer_restart watchdog_timer_fn(struct hrtimer *hrtimer)
 		else
 			dump_stack();
 
+		WARN(1, "Watchdog detected soft LOCKUP on cpu %d",
+			smp_processor_id());
+
 		if (softlockup_all_cpu_backtrace) {
 			/* Avoid generating two back traces for current
 			 * given that one is already made above
-- 
1.8.3.1

[toc] | [next] | [standalone]


#1323511

FromDon Zickus <dzickus@redhat.com>
Date2016-02-01 22:10 +0100
Message-ID<qXtTt-iU-25@gated-at.bofh.it>
In reply to#1323490
On Mon, Feb 01, 2016 at 01:45:27PM -0700, Jeffrey Merkey wrote:
> This patch series adds config options which can be set during compile to
> direct the compiler to output a breakpoint instruction anywhere a BUG_XX()
> or WARN_XX() macro has been placed in the kernel to trigger the system to
> enter a debugger if a bug is detected by the system.  Use of this compile
> time option also allows conditional breakpoints to be set in the kernel
> where these macros have been previously placed.
> 
> This addition is extremely useful for debugging hard and soft lockups
> real time and quickly from a console debugger, and other areas of the
> kernel.
> 
> Signed-off-by: Jeffrey Merkey <jeffmerkey@gmail.com>
> ---
>  kernel/watchdog.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/kernel/watchdog.c b/kernel/watchdog.c
> index b3ace6e..af07a83 100644
> --- a/kernel/watchdog.c
> +++ b/kernel/watchdog.c
> @@ -358,6 +358,8 @@ static void watchdog_overflow_callback(struct perf_event *event,
>  		else
>  			dump_stack();
>  
> +		WARN(1, "Watchdog detected hard LOCKUP on cpu %d", this_cpu);
> +

So we repeat the same exact print message and dump the same stack again as
we do a few lines above?  That doesn't make any sense.

Cheers,
Don

>  		/*
>  		 * Perform all-CPU dump only once to avoid multiple hardlockups
>  		 * generating interleaving traces
> @@ -478,6 +480,9 @@ static enum hrtimer_restart watchdog_timer_fn(struct hrtimer *hrtimer)
>  		else
>  			dump_stack();
>  
> +		WARN(1, "Watchdog detected soft LOCKUP on cpu %d",
> +			smp_processor_id());
> +
>  		if (softlockup_all_cpu_backtrace) {
>  			/* Avoid generating two back traces for current
>  			 * given that one is already made above
> -- 
> 1.8.3.1
> 

[toc] | [prev] | [next] | [standalone]


#1323520

FromJeffrey Merkey <jeffmerkey@gmail.com>
Date2016-02-01 22:20 +0100
Message-ID<qXu38-mK-21@gated-at.bofh.it>
In reply to#1323511
>>
>> +		WARN(1, "Watchdog detected hard LOCKUP on cpu %d", this_cpu);
>> +
>
> So we repeat the same exact print message and dump the same stack again as
> we do a few lines above?  That doesn't make any sense.
>
> Cheers,
> Don
>

Agreed.  I'll go back and work on it.

Jeff

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web