public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix scheduling-while-atomic problem in console_cpu_notify()
@ 2012-10-16  0:31 Paul E. McKenney
  2012-10-16  4:35 ` Paul E. McKenney
  0 siblings, 1 reply; 3+ messages in thread
From: Paul E. McKenney @ 2012-10-16  0:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: cernekee, torbenh, torvalds, tglx, srivatsa.bhat

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>

diff --git a/kernel/printk.c b/kernel/printk.c
index 66a2ea3..8e23a14 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -1889,7 +1889,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:


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix scheduling-while-atomic problem in console_cpu_notify()
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Paul E. McKenney @ 2012-10-16  4:35 UTC (permalink / raw)
  To: linux-kernel; +Cc: cernekee, torbenh, torvalds, tglx, srivatsa.bhat

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>

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix scheduling-while-atomic problem in console_cpu_notify()
  2012-10-16  4:35 ` Paul E. McKenney
@ 2012-10-16  5:31   ` Srivatsa S. Bhat
  0 siblings, 0 replies; 3+ messages in thread
From: Srivatsa S. Bhat @ 2012-10-16  5:31 UTC (permalink / raw)
  To: paulmck; +Cc: linux-kernel, cernekee, torbenh, torvalds, tglx

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-10-16  5:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox