linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Hurley <peter@hurleysoftware.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Byungchul Park <byungchul.park@lge.com>
Cc: mingo@kernel.org, linux-kernel@vger.kernel.org,
	akinobu.mita@gmail.com, jack@suse.cz,
	torvalds@linux-foundation.org
Subject: Re: [PATCH v2] lib/spinlock_debug.c: prevent an infinite recursive cycle in spin_dump()
Date: Tue, 26 Jan 2016 17:13:08 -0800	[thread overview]
Message-ID: <56A819A4.3080702@hurleysoftware.com> (raw)
In-Reply-To: <20160126161124.cba2f003a4a21a6f11cf51a8@linux-foundation.org>

On 01/26/2016 04:11 PM, Andrew Morton wrote:
> On Mon, 18 Jan 2016 09:58:12 +0900 Byungchul Park <byungchul.park@lge.com> wrote:
> 
>> It causes an infinite recursive cycle when using CONFIG_DEBUG_SPINLOCK,
>> in the spin_dump(). Backtrace prints printk() -> console_trylock() ->
>> do_raw_spin_lock() -> spint_bug() -> spin_dump() -> printk()...
>> infinitely.
>>
>> If the spin_bug() is called from a function like printk() which is
>> trying to obtain the console lock, we should prevent the debug spinlock
>> code from calling printk() again in that context.
>>
> 
> lol.  Excellent.

[...]

> I can't immediately think of anything better than this.  It's a hack, but
> it's a small and quite clear hack.

Andrew,

I think you may have missed this follow-up from Byungchul:

On 01/21/2016 12:12 AM, Byungchul Park wrote:
> I was careless. I think it should be fixed by another way, instead of
> the way this patch suggested.

Regards,
Peter Hurley

  reply	other threads:[~2016-01-27  1:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-18  0:58 [PATCH v2] lib/spinlock_debug.c: prevent an infinite recursive cycle in spin_dump() Byungchul Park
2016-01-19  1:53 ` Byungchul Park
2016-01-21  8:12   ` Byungchul Park
2016-01-27  0:11 ` Andrew Morton
2016-01-27  1:13   ` Peter Hurley [this message]
2016-01-27  2:00   ` Byungchul Park
2016-01-27  2:22     ` Byungchul Park

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=56A819A4.3080702@hurleysoftware.com \
    --to=peter@hurleysoftware.com \
    --cc=akinobu.mita@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=byungchul.park@lge.com \
    --cc=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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 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).