linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] blk-mq: fix blk_mq_start_stopped_hw_queues from irq context
@ 2013-10-06 17:09 Christoph Hellwig
  2013-10-06 18:10 ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2013-10-06 17:09 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-kernel

The only caller of blk_mq_start_stopped_hw_queues is in irq context,
leading to lockdep splat when it actually gets called.  Fix this by
deferring the hw queue run to workqueue context.

Signed-off-by: Christoph Hellwig <hch@lst.de>

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 2b85029..923e9e1 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -686,7 +686,8 @@ void blk_mq_start_stopped_hw_queues(struct request_queue *q)
 		if (!test_bit(BLK_MQ_S_STOPPED, &hctx->state))
 			continue;
 
-		blk_mq_start_hw_queue(hctx);
+		clear_bit(BLK_MQ_S_STOPPED, &hctx->state);
+		blk_mq_run_hw_queue(hctx, true);
 	}
 }
 EXPORT_SYMBOL(blk_mq_start_stopped_hw_queues);

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

* Re: [PATCH] blk-mq: fix blk_mq_start_stopped_hw_queues from irq context
  2013-10-06 17:09 [PATCH] blk-mq: fix blk_mq_start_stopped_hw_queues from irq context Christoph Hellwig
@ 2013-10-06 18:10 ` Jens Axboe
  2013-10-07 19:33   ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Jens Axboe @ 2013-10-06 18:10 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-kernel

On Sun, Oct 06 2013, Christoph Hellwig wrote:
> The only caller of blk_mq_start_stopped_hw_queues is in irq context,
> leading to lockdep splat when it actually gets called.  Fix this by
> deferring the hw queue run to workqueue context.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> 
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index 2b85029..923e9e1 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -686,7 +686,8 @@ void blk_mq_start_stopped_hw_queues(struct request_queue *q)
>  		if (!test_bit(BLK_MQ_S_STOPPED, &hctx->state))
>  			continue;
>  
> -		blk_mq_start_hw_queue(hctx);
> +		clear_bit(BLK_MQ_S_STOPPED, &hctx->state);
> +		blk_mq_run_hw_queue(hctx, true);
>  	}
>  }
>  EXPORT_SYMBOL(blk_mq_start_stopped_hw_queues);

Thanks, applied. Might not be a bad idea to just mimic the run queue
API, and provide a blk_mq_start_hw_queue(hctx, is_async) instead.

-- 
Jens Axboe


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

* Re: [PATCH] blk-mq: fix blk_mq_start_stopped_hw_queues from irq context
  2013-10-06 18:10 ` Jens Axboe
@ 2013-10-07 19:33   ` Christoph Hellwig
  0 siblings, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2013-10-07 19:33 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Christoph Hellwig, linux-kernel

On Sun, Oct 06, 2013 at 12:10:13PM -0600, Jens Axboe wrote:
> Thanks, applied. Might not be a bad idea to just mimic the run queue
> API, and provide a blk_mq_start_hw_queue(hctx, is_async) instead.

I have to see I really don't like this is_async, I'd much preper to
untangle those into separate versions further up the stack similar to
how the old blk_run_queue variants work.

But that'll have to wait a bit anyway, at least until you made a
decision on the plugging patch.


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

end of thread, other threads:[~2013-10-07 19:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-06 17:09 [PATCH] blk-mq: fix blk_mq_start_stopped_hw_queues from irq context Christoph Hellwig
2013-10-06 18:10 ` Jens Axboe
2013-10-07 19:33   ` Christoph Hellwig

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