All of lore.kernel.org
 help / color / mirror / Atom feed
From: Don Zickus <dzickus@redhat.com>
To: Jeffrey Merkey <jeffmerkey@gmail.com>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	atomlin@redhat.com, cmetcalf@ezchip.com, fweisbec@gmail.com,
	hidehiro.kawai.ez@hitachi.com, mhocko@suse.cz, tj@kernel.org,
	uobergfe@redhat.com
Subject: Re: [PATCH v5 3/3] Add BUG_XX() debugging hard/soft lockup detection
Date: Tue, 2 Feb 2016 12:30:34 -0500	[thread overview]
Message-ID: <20160202173034.GG26637@redhat.com> (raw)
In-Reply-To: <1454380428-31474-3-git-send-email-jeffmerkey@gmail.com>

On Mon, Feb 01, 2016 at 07:33:48PM -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()
> 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 with these currently used macros.
> 
> 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.

Please remember to add version history, so I can tell what changed.

> 
> Signed-off-by: Jeffrey Merkey <jeffmerkey@gmail.com>
> ---
>  kernel/watchdog.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/kernel/watchdog.c b/kernel/watchdog.c
> index b3ace6e..c504f7c 100644
> --- a/kernel/watchdog.c
> +++ b/kernel/watchdog.c
> @@ -44,6 +44,12 @@
>  #define NMI_WATCHDOG_ENABLED      (1 << NMI_WATCHDOG_ENABLED_BIT)
>  #define SOFT_WATCHDOG_ENABLED     (1 << SOFT_WATCHDOG_ENABLED_BIT)
>  
> +#ifdef CONFIG_DEBUG_BUG
> +#define WATCHDOG_DEBUG_LOCKUP  1
> +#else
> +#define WATCHDOG_DEBUG_LOCKUP  0
> +#endif
> +
>  static DEFINE_MUTEX(watchdog_proc_mutex);
>  
>  #ifdef CONFIG_HARDLOCKUP_DETECTOR
> @@ -358,6 +364,8 @@ static void watchdog_overflow_callback(struct perf_event *event,
>  		else
>  			dump_stack();
>  
> +		BUG_ON(WATCHDOG_DEBUG_LOCKUP);
> +

I am not sure I am a fan of this.  You are taking a known macro BUG_ON with
known expectations and perversely converting it into an 'asm'.  So now when
folks read the code they scratch their heads why we are dumping the stack
twice when in fact we are not. It seems misleading. :-/

I still don't understand why we can't use Ingo's or tglx's approach?  Your
changelog doesn't point out the problems there.

Cheers,
Don

>  		/*
>  		 * Perform all-CPU dump only once to avoid multiple hardlockups
>  		 * generating interleaving traces
> @@ -478,6 +486,8 @@ static enum hrtimer_restart watchdog_timer_fn(struct hrtimer *hrtimer)
>  		else
>  			dump_stack();
>  
> +		BUG_ON(WATCHDOG_DEBUG_LOCKUP);
> +
>  		if (softlockup_all_cpu_backtrace) {
>  			/* Avoid generating two back traces for current
>  			 * given that one is already made above
> -- 
> 1.8.3.1
> 

  reply	other threads:[~2016-02-02 17:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-02  2:33 [PATCH v5 1/3] Add BUG_XX() debugging options Jeffrey Merkey
2016-02-02  2:33 ` [PATCH v5 2/3] Add BUG_XX() debugging options Kconfig.debug Jeffrey Merkey
2016-02-02  2:33 ` [PATCH v5 3/3] Add BUG_XX() debugging hard/soft lockup detection Jeffrey Merkey
2016-02-02 17:30   ` Don Zickus [this message]
2016-02-02 22:40     ` Jeffrey Merkey
2016-02-03  4:17       ` Jeffrey Merkey
2016-02-03  4:39         ` Jeffrey Merkey
2016-02-03 15:45       ` Don Zickus
2016-02-03 17:23         ` Jeffrey Merkey
2016-02-03 20:14           ` Don Zickus
2016-02-03 20:18             ` Jeffrey Merkey
2016-02-04  2:48               ` Jeffrey Merkey
2016-02-03 15:47       ` Don Zickus
2016-02-03 17:26         ` Jeffrey Merkey

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=20160202173034.GG26637@redhat.com \
    --to=dzickus@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=atomlin@redhat.com \
    --cc=cmetcalf@ezchip.com \
    --cc=fweisbec@gmail.com \
    --cc=hidehiro.kawai.ez@hitachi.com \
    --cc=jeffmerkey@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhocko@suse.cz \
    --cc=tj@kernel.org \
    --cc=uobergfe@redhat.com \
    /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 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.