public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
To: paulmck@linux.vnet.ibm.com
Cc: linux-kernel@vger.kernel.org, cernekee@gmail.com, torbenh@gmx.de,
	torvalds@linux-foundation.org, tglx@linutronix.de
Subject: Re: [PATCH] Fix scheduling-while-atomic problem in console_cpu_notify()
Date: Tue, 16 Oct 2012 11:01:16 +0530	[thread overview]
Message-ID: <507CF124.4000500@linux.vnet.ibm.com> (raw)
In-Reply-To: <20121016043559.GA32179@linux.vnet.ibm.com>

On 10/16/2012 10:05 AM, Paul E. McKenney wrote:
> On Mon, Oct 15, 2012 at 05:31:28PM -0700, Paul E. McKenney wrote:
>> The console_cpu_notify( function runs with interrupts disabled in
>> the CPU_DEAD case.  It therefore cannot block, for example, as will
>> happen when it calls console_lock().  Therefore, remove the CPU_DEAD
>> leg of the switch statement to avoid this problem.
>>
>> Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
> 
> s/CPU_DEAD/CPU_DYING/
> 
> Apparently it is a bad idea to compose and send a patch while in a
> C++ standards committee meeting where people are arguing about async
> futures...  Fixed patch below.
> 
> 							Thanx, Paul
> 
> ------------------------------------------------------------------------
> 
> printk: Fix scheduling-while-atomic problem in console_cpu_notify()
> 
> The console_cpu_notify( function runs with interrupts disabled in
> the CPU_DYING case.  It therefore cannot block, for example, as will
> happen when it calls console_lock().  Therefore, remove the CPU_DYING
> leg of the switch statement to avoid this problem.
> 
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> 

Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>

Regards,
Srivatsa S. Bhat

> diff --git a/kernel/printk.c b/kernel/printk.c
> index 66a2ea3..2d607f4 100644
> --- a/kernel/printk.c
> +++ b/kernel/printk.c
> @@ -1890,7 +1890,6 @@ static int __cpuinit console_cpu_notify(struct notifier_block *self,
>  	switch (action) {
>  	case CPU_ONLINE:
>  	case CPU_DEAD:
> -	case CPU_DYING:
>  	case CPU_DOWN_FAILED:
>  	case CPU_UP_CANCELED:
>  		console_lock();
> 



      reply	other threads:[~2012-10-16  5:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-16  0:31 [PATCH] Fix scheduling-while-atomic problem in console_cpu_notify() Paul E. McKenney
2012-10-16  4:35 ` Paul E. McKenney
2012-10-16  5:31   ` Srivatsa S. Bhat [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=507CF124.4000500@linux.vnet.ibm.com \
    --to=srivatsa.bhat@linux.vnet.ibm.com \
    --cc=cernekee@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=torbenh@gmx.de \
    --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