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


Groups > linux.kernel > #1356160

Re: [PATCH] kernel: panic: make panic() local lock raw

From Andrew Morton <akpm@linux-foundation.org>
Newsgroups linux.kernel
Subject Re: [PATCH] kernel: panic: make panic() local lock raw
Date 2016-03-11 21:10 +0100
Message-ID <rbBxL-2Xc-1@gated-at.bofh.it> (permalink)
References <rbzmh-1in-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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();

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] kernel: panic: make panic() local lock raw Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-03-11 18:50 +0100
  Re: [PATCH] kernel: panic: make panic() local lock raw Andrew Morton <akpm@linux-foundation.org> - 2016-03-11 21:10 +0100

csiph-web