mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH] kernel: panic: make panic() local lock raw
Date: Fri, 11 Mar 2016 12:08:18 -0800	[thread overview]
Message-ID: <20160311120818.069a1c742540e1693bd9e60b@linux-foundation.org> (raw)
In-Reply-To: <1457718505-25304-1-git-send-email-bigeasy@linutronix.de>

On Fri, 11 Mar 2016 18:48:25 +0100 Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote:

> The lock is taken with disabled interrupts and therefore it must be
> a RAW lock. Otherwise -RT will convert it into a sleeping lock and
> complain about it.

panic_lock doesn't exist in current kernels.

However you may want to take a look at pause_on_oops_lock - strange
things are happening with IRQs there.

> --- a/kernel/panic.c
> +++ b/kernel/panic.c
> @@ -71,7 +71,7 @@ void __weak panic_smp_self_stop(void)
>   */
>  void panic(const char *fmt, ...)
>  {
> -	static DEFINE_SPINLOCK(panic_lock);
> +	static DEFINE_RAW_SPINLOCK(panic_lock);

This should have had a comment explaining why a raw spinlock was chosen.

>  	static char buf[1024];
>  	va_list args;
>  	long i, i_next = 0;
> @@ -95,7 +95,7 @@ void panic(const char *fmt, ...)
>  	 * stop themself or will wait until they are stopped by the 1st CPU
>  	 * with smp_send_stop().
>  	 */
> -	if (!spin_trylock(&panic_lock))
> +	if (!raw_spin_trylock(&panic_lock))
>  		panic_smp_self_stop();
>  
>  	console_verbose();

      reply	other threads:[~2016-03-11 20:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-11 17:48 Sebastian Andrzej Siewior
2016-03-11 20:08 ` Andrew Morton [this message]

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=20160311120818.069a1c742540e1693bd9e60b@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=bigeasy@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®