All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Metcalf <cmetcalf@ezchip.com>
To: Jeffrey Merkey <jeffmerkey@gmail.com>, <linux-kernel@vger.kernel.org>
Cc: <akpm@linux-foundation.org>, <dzickus@redhat.com>,
	<uobergfe@redhat.com>, <atomlin@redhat.com>, <mhocko@suse.cz>,
	<fweisbec@gmail.com>, <tj@kernel.org>,
	<hidehiro.kawai.ez@hitachi.com>, <tglx@linutronix.de>
Subject: Re: [PATCH 01/31] Add hard/soft lockup debugger entry points
Date: Thu, 28 Jan 2016 15:41:56 -0500	[thread overview]
Message-ID: <56AA7D14.5090407@ezchip.com> (raw)
In-Reply-To: <1454010366-28416-1-git-send-email-jeffmerkey@gmail.com>

On 01/28/2016 02:46 PM, Jeffrey Merkey wrote:
> This patch series adds an export which can be set by system debuggers to
> direct the hard lockup and soft lockup detector to trigger a breakpoint
> exception and enter a debugger if one is active.  It is assumed that if
> someone sets this variable, then an breakpoint handler of some sort will
> be actively loaded or registered via the notify die handler chain.
>
> This addition is extremely useful for debugging hard and soft lockups
> real time and quickly from a console debugger.

I'm concerned that you are duplicating the breakpoint instructions
for all the platforms.  Could you make kgdb.h include kdebug.h and
just move the arch_kgdb_breakpoint() implementations in kgdb.h to
arch_breakpoint() in kdebug.h?  Then each platform can just put an
appropriate define in kgdb.h, e.g. "#define arch_kgdb_breakpoint
arch_breakpoint", unless (like mips) they have a more complicated
requirement.

I'm concerned that in some cases (e.g. arm64) there is a perfectly good
breakpoint defined in kgdb.h but you are providing a no-op in kdebug.h.
You should probably do another check across all the architectures for
this case.

You should probably add your no-op implementation of arch_breakpoint()
to asm-generic/kdebug.h, and then add "generic-y" lines to the Kbuild
files for the architectures that you are creating new empty files for.
I'm a little ambivalent about the "silent no-op" implementation, but I'm
not really sure there's a better option.

For mips, I'm pretty sure you don't want to create a global "breakinst"
symbol every time you insert a breakpoint into code.  I think this is an
example of where you need to have a different implementation of
arch_breakpoint() and arch_kgdb_breakpoint(), since mips makes its
breakpoint magical by knowing what the address used for that specific
instruction is, and you can't do that for arch_breakpoint().

As a general rule, you probably want to provide header guards in new
headers that you create, but if you just use asm-generic instead, it
actually won't matter for this case.

I should add that I didn't do a thorough review of the patch series,
just a quick skim of a few of the architectures.

-- 
Chris Metcalf, EZChip Semiconductor
http://www.ezchip.com

  parent reply	other threads:[~2016-01-28 22:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-28 19:46 [PATCH 01/31] Add hard/soft lockup debugger entry points Jeffrey Merkey
2016-01-28 19:56 ` Thomas Gleixner
2016-01-28 20:08   ` Jeffrey Merkey
2016-01-28 20:48     ` Thomas Gleixner
2016-01-28 20:58       ` Jeffrey Merkey
2016-01-28 22:06         ` Thomas Gleixner
2016-01-28 22:22           ` Jeffrey Merkey
2016-01-29  8:16         ` Ingo Molnar
2016-01-29 16:26           ` Jeffrey Merkey
2016-01-29 16:34           ` Jeffrey Merkey
2016-01-29 17:19             ` Jeffrey Merkey
2016-01-30  2:43           ` Jeffrey Merkey
2016-01-28 20:35 ` kbuild test robot
2016-01-28 20:41 ` Chris Metcalf [this message]
2016-01-28 20:48   ` 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=56AA7D14.5090407@ezchip.com \
    --to=cmetcalf@ezchip.com \
    --cc=akpm@linux-foundation.org \
    --cc=atomlin@redhat.com \
    --cc=dzickus@redhat.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=tglx@linutronix.de \
    --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.