linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] rt,blk,mq: Make blk_mq_cpu_notify_lock a raw spinlock
@ 2014-03-03  4:57 Mike Galbraith
  2014-03-03 16:34 ` Jens Axboe
  2014-03-07 16:00 ` Sebastian Andrzej Siewior
  0 siblings, 2 replies; 4+ messages in thread
From: Mike Galbraith @ 2014-03-03  4:57 UTC (permalink / raw)
  To: Jens Axboe; +Cc: LKML, RT


[  365.164040] BUG: sleeping function called from invalid context at kernel/rtmutex.c:674
[  365.164041] in_atomic(): 1, irqs_disabled(): 1, pid: 26, name: migration/1
[  365.164043] no locks held by migration/1/26.
[  365.164044] irq event stamp: 6648
[  365.164056] hardirqs last  enabled at (6647): [<ffffffff8153d377>] restore_args+0x0/0x30
[  365.164062] hardirqs last disabled at (6648): [<ffffffff810ed98d>] multi_cpu_stop+0x9d/0x120
[  365.164070] softirqs last  enabled at (0): [<ffffffff810543bc>] copy_process.part.28+0x6fc/0x1920
[  365.164072] softirqs last disabled at (0): [<          (null)>]           (null)
[  365.164076] CPU: 1 PID: 26 Comm: migration/1 Tainted: GF           N  3.12.12-rt19-0.gcb6c4a2-rt #3
[  365.164078] Hardware name: QCI QSSC-S4R/QSSC-S4R, BIOS QSSC-S4R.QCI.01.00.S013.032920111005 03/29/2011
[  365.164091]  0000000000000001 ffff880a42ea7c30 ffffffff815367e6 ffffffff81a086c0
[  365.164099]  ffff880a42ea7c40 ffffffff8108919c ffff880a42ea7c60 ffffffff8153c24f
[  365.164107]  ffff880a42ea91f0 00000000ffffffe1 ffff880a42ea7c88 ffffffff81297ec0
[  365.164108] Call Trace:
[  365.164119]  [<ffffffff810060b1>] try_stack_unwind+0x191/0x1a0
[  365.164127]  [<ffffffff81004872>] dump_trace+0x92/0x360
[  365.164133]  [<ffffffff81006108>] show_trace_log_lvl+0x48/0x60
[  365.164138]  [<ffffffff81004c18>] show_stack_log_lvl+0xd8/0x1d0
[  365.164143]  [<ffffffff81006160>] show_stack+0x20/0x50
[  365.164153]  [<ffffffff815367e6>] dump_stack+0x54/0x9a
[  365.164163]  [<ffffffff8108919c>] __might_sleep+0xfc/0x140
[  365.164173]  [<ffffffff8153c24f>] rt_spin_lock+0x1f/0x70
[  365.164182]  [<ffffffff81297ec0>] blk_mq_main_cpu_notify+0x20/0x70
[  365.164191]  [<ffffffff81540a1c>] notifier_call_chain+0x4c/0x70
[  365.164201]  [<ffffffff81083499>] __raw_notifier_call_chain+0x9/0x10
[  365.164207]  [<ffffffff810567be>] cpu_notify+0x1e/0x40
[  365.164217]  [<ffffffff81525da2>] take_cpu_down+0x22/0x40
[  365.164223]  [<ffffffff810ed9c6>] multi_cpu_stop+0xd6/0x120
[  365.164229]  [<ffffffff810edd97>] cpu_stopper_thread+0xd7/0x1e0
[  365.164235]  [<ffffffff810863a3>] smpboot_thread_fn+0x203/0x380
[  365.164241]  [<ffffffff8107cbf8>] kthread+0xc8/0xd0
[  365.164250]  [<ffffffff8154440c>] ret_from_fork+0x7c/0xb0
[  365.164429] smpboot: CPU 1 is now offline

Signed-off-by: Mike Galbraith <bitbucket@online.de>
---
 block/blk-mq-cpu.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

--- a/block/blk-mq-cpu.c
+++ b/block/blk-mq-cpu.c
@@ -11,7 +11,7 @@
 #include "blk-mq.h"
 
 static LIST_HEAD(blk_mq_cpu_notify_list);
-static DEFINE_SPINLOCK(blk_mq_cpu_notify_lock);
+static DEFINE_RAW_SPINLOCK(blk_mq_cpu_notify_lock);
 
 static int blk_mq_main_cpu_notify(struct notifier_block *self,
 				  unsigned long action, void *hcpu)
@@ -19,12 +19,12 @@ static int blk_mq_main_cpu_notify(struct
 	unsigned int cpu = (unsigned long) hcpu;
 	struct blk_mq_cpu_notifier *notify;
 
-	spin_lock(&blk_mq_cpu_notify_lock);
+	raw_spin_lock(&blk_mq_cpu_notify_lock);
 
 	list_for_each_entry(notify, &blk_mq_cpu_notify_list, list)
 		notify->notify(notify->data, action, cpu);
 
-	spin_unlock(&blk_mq_cpu_notify_lock);
+	raw_spin_unlock(&blk_mq_cpu_notify_lock);
 	return NOTIFY_OK;
 }
 
@@ -32,16 +32,16 @@ void blk_mq_register_cpu_notifier(struct
 {
 	BUG_ON(!notifier->notify);
 
-	spin_lock(&blk_mq_cpu_notify_lock);
+	raw_spin_lock(&blk_mq_cpu_notify_lock);
 	list_add_tail(&notifier->list, &blk_mq_cpu_notify_list);
-	spin_unlock(&blk_mq_cpu_notify_lock);
+	raw_spin_unlock(&blk_mq_cpu_notify_lock);
 }
 
 void blk_mq_unregister_cpu_notifier(struct blk_mq_cpu_notifier *notifier)
 {
-	spin_lock(&blk_mq_cpu_notify_lock);
+	raw_spin_lock(&blk_mq_cpu_notify_lock);
 	list_del(&notifier->list);
-	spin_unlock(&blk_mq_cpu_notify_lock);
+	raw_spin_unlock(&blk_mq_cpu_notify_lock);
 }
 
 void blk_mq_init_cpu_notifier(struct blk_mq_cpu_notifier *notifier,



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

* Re: [patch] rt,blk,mq: Make blk_mq_cpu_notify_lock a raw spinlock
  2014-03-03  4:57 [patch] rt,blk,mq: Make blk_mq_cpu_notify_lock a raw spinlock Mike Galbraith
@ 2014-03-03 16:34 ` Jens Axboe
  2014-03-07 16:00 ` Sebastian Andrzej Siewior
  1 sibling, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2014-03-03 16:34 UTC (permalink / raw)
  To: Mike Galbraith; +Cc: LKML, RT

On 03/02/2014 09:57 PM, Mike Galbraith wrote:
>
> [  365.164040] BUG: sleeping function called from invalid context at kernel/rtmutex.c:674
> [  365.164041] in_atomic(): 1, irqs_disabled(): 1, pid: 26, name: migration/1
> [  365.164043] no locks held by migration/1/26.
> [  365.164044] irq event stamp: 6648
> [  365.164056] hardirqs last  enabled at (6647): [<ffffffff8153d377>] restore_args+0x0/0x30
> [  365.164062] hardirqs last disabled at (6648): [<ffffffff810ed98d>] multi_cpu_stop+0x9d/0x120
> [  365.164070] softirqs last  enabled at (0): [<ffffffff810543bc>] copy_process.part.28+0x6fc/0x1920
> [  365.164072] softirqs last disabled at (0): [<          (null)>]           (null)
> [  365.164076] CPU: 1 PID: 26 Comm: migration/1 Tainted: GF           N  3.12.12-rt19-0.gcb6c4a2-rt #3
> [  365.164078] Hardware name: QCI QSSC-S4R/QSSC-S4R, BIOS QSSC-S4R.QCI.01.00.S013.032920111005 03/29/2011
> [  365.164091]  0000000000000001 ffff880a42ea7c30 ffffffff815367e6 ffffffff81a086c0
> [  365.164099]  ffff880a42ea7c40 ffffffff8108919c ffff880a42ea7c60 ffffffff8153c24f
> [  365.164107]  ffff880a42ea91f0 00000000ffffffe1 ffff880a42ea7c88 ffffffff81297ec0
> [  365.164108] Call Trace:
> [  365.164119]  [<ffffffff810060b1>] try_stack_unwind+0x191/0x1a0
> [  365.164127]  [<ffffffff81004872>] dump_trace+0x92/0x360
> [  365.164133]  [<ffffffff81006108>] show_trace_log_lvl+0x48/0x60
> [  365.164138]  [<ffffffff81004c18>] show_stack_log_lvl+0xd8/0x1d0
> [  365.164143]  [<ffffffff81006160>] show_stack+0x20/0x50
> [  365.164153]  [<ffffffff815367e6>] dump_stack+0x54/0x9a
> [  365.164163]  [<ffffffff8108919c>] __might_sleep+0xfc/0x140
> [  365.164173]  [<ffffffff8153c24f>] rt_spin_lock+0x1f/0x70
> [  365.164182]  [<ffffffff81297ec0>] blk_mq_main_cpu_notify+0x20/0x70
> [  365.164191]  [<ffffffff81540a1c>] notifier_call_chain+0x4c/0x70
> [  365.164201]  [<ffffffff81083499>] __raw_notifier_call_chain+0x9/0x10
> [  365.164207]  [<ffffffff810567be>] cpu_notify+0x1e/0x40
> [  365.164217]  [<ffffffff81525da2>] take_cpu_down+0x22/0x40
> [  365.164223]  [<ffffffff810ed9c6>] multi_cpu_stop+0xd6/0x120
> [  365.164229]  [<ffffffff810edd97>] cpu_stopper_thread+0xd7/0x1e0
> [  365.164235]  [<ffffffff810863a3>] smpboot_thread_fn+0x203/0x380
> [  365.164241]  [<ffffffff8107cbf8>] kthread+0xc8/0xd0
> [  365.164250]  [<ffffffff8154440c>] ret_from_fork+0x7c/0xb0
> [  365.164429] smpboot: CPU 1 is now offline
>
> Signed-off-by: Mike Galbraith <bitbucket@online.de>

Dirty! Applied, thanks :)

-- 
Jens Axboe

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

* Re: [patch] rt,blk,mq: Make blk_mq_cpu_notify_lock a raw spinlock
  2014-03-03  4:57 [patch] rt,blk,mq: Make blk_mq_cpu_notify_lock a raw spinlock Mike Galbraith
  2014-03-03 16:34 ` Jens Axboe
@ 2014-03-07 16:00 ` Sebastian Andrzej Siewior
  2014-03-07 17:16   ` Mike Galbraith
  1 sibling, 1 reply; 4+ messages in thread
From: Sebastian Andrzej Siewior @ 2014-03-07 16:00 UTC (permalink / raw)
  To: Mike Galbraith; +Cc: Jens Axboe, LKML, RT

* Mike Galbraith | 2014-03-03 05:57:26 [+0100]:

> block/blk-mq-cpu.c |   14 +++++++-------

This got in v3.13-rc1, are you running some kind of backported version
of this in v3.12 or do you have your own v3.13-rt?

Sebastian

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

* Re: [patch] rt,blk,mq: Make blk_mq_cpu_notify_lock a raw spinlock
  2014-03-07 16:00 ` Sebastian Andrzej Siewior
@ 2014-03-07 17:16   ` Mike Galbraith
  0 siblings, 0 replies; 4+ messages in thread
From: Mike Galbraith @ 2014-03-07 17:16 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior; +Cc: Jens Axboe, LKML, RT

On Fri, 2014-03-07 at 17:00 +0100, Sebastian Andrzej Siewior wrote: 
> * Mike Galbraith | 2014-03-03 05:57:26 [+0100]:
> 
> > block/blk-mq-cpu.c |   14 +++++++-------
> 
> This got in v3.13-rc1, are you running some kind of backported version
> of this in v3.12 or do you have your own v3.13-rt?

It's 3.12, but with a few (koff) backports.

-Mike

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

end of thread, other threads:[~2014-03-07 17:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-03  4:57 [patch] rt,blk,mq: Make blk_mq_cpu_notify_lock a raw spinlock Mike Galbraith
2014-03-03 16:34 ` Jens Axboe
2014-03-07 16:00 ` Sebastian Andrzej Siewior
2014-03-07 17:16   ` Mike Galbraith

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).