linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6] block: support blk-mq on  blk_run_queue/blk_run_queue_async.
@ 2013-11-29  8:41 majianpeng
  2013-12-23  6:27 ` Nicholas A. Bellinger
  0 siblings, 1 reply; 2+ messages in thread
From: majianpeng @ 2013-11-29  8:41 UTC (permalink / raw)
  To: nab; +Cc: linux-scsi

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
---
 block/blk-core.c |   21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index bf44ca0..549d83e 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -304,8 +304,12 @@ EXPORT_SYMBOL(__blk_run_queue);
  */
 void blk_run_queue_async(struct request_queue *q)
 {
-	if (likely(!blk_queue_stopped(q) && !blk_queue_dead(q)))
-		mod_delayed_work(kblockd_workqueue, &q->delay_work, 0);
+	if (likely(!blk_queue_stopped(q) && !blk_queue_dead(q))) {
+		if (q->mq_ops)
+			blk_mq_run_queues(q, 1);
+		else
+			mod_delayed_work(kblockd_workqueue, &q->delay_work, 0);
+	}
 }
 EXPORT_SYMBOL(blk_run_queue_async);
 
@@ -319,11 +323,14 @@ EXPORT_SYMBOL(blk_run_queue_async);
  */
 void blk_run_queue(struct request_queue *q)
 {
-	unsigned long flags;
-
-	spin_lock_irqsave(q->queue_lock, flags);
-	__blk_run_queue(q);
-	spin_unlock_irqrestore(q->queue_lock, flags);
+	if (q->mq_ops)
+		blk_mq_run_queues(q, 0);
+	else {
+		unsigned long flags;
+		spin_lock_irqsave(q->queue_lock, flags);
+		__blk_run_queue(q);
+		spin_unlock_irqrestore(q->queue_lock, flags);
+	}
 }
 EXPORT_SYMBOL(blk_run_queue);
 
-- 
1.7.10.4

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

* Re: [PATCH 1/6] block: support blk-mq on blk_run_queue/blk_run_queue_async.
  2013-11-29  8:41 [PATCH 1/6] block: support blk-mq on blk_run_queue/blk_run_queue_async majianpeng
@ 2013-12-23  6:27 ` Nicholas A. Bellinger
  0 siblings, 0 replies; 2+ messages in thread
From: Nicholas A. Bellinger @ 2013-12-23  6:27 UTC (permalink / raw)
  To: majianpeng; +Cc: linux-scsi, Jens Axboe, Christoph Hellwig

Hi Jianpeng,

Apologies for the long delayed response on this series. 

Comments are inline.

On Fri, 2013-11-29 at 16:41 +0800, majianpeng wrote:
> Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
> ---
>  block/blk-core.c |   21 ++++++++++++++-------
>  1 file changed, 14 insertions(+), 7 deletions(-)
> 
> diff --git a/block/blk-core.c b/block/blk-core.c
> index bf44ca0..549d83e 100644
> --- a/block/blk-core.c
> +++ b/block/blk-core.c
> @@ -304,8 +304,12 @@ EXPORT_SYMBOL(__blk_run_queue);
>   */
>  void blk_run_queue_async(struct request_queue *q)
>  {
> -	if (likely(!blk_queue_stopped(q) && !blk_queue_dead(q)))
> -		mod_delayed_work(kblockd_workqueue, &q->delay_work, 0);
> +	if (likely(!blk_queue_stopped(q) && !blk_queue_dead(q))) {
> +		if (q->mq_ops)
> +			blk_mq_run_queues(q, 1);
> +		else
> +			mod_delayed_work(kblockd_workqueue, &q->delay_work, 0);
> +	}
>  }
>  EXPORT_SYMBOL(blk_run_queue_async);
>  
> @@ -319,11 +323,14 @@ EXPORT_SYMBOL(blk_run_queue_async);
>   */
>  void blk_run_queue(struct request_queue *q)
>  {
> -	unsigned long flags;
> -
> -	spin_lock_irqsave(q->queue_lock, flags);
> -	__blk_run_queue(q);
> -	spin_unlock_irqrestore(q->queue_lock, flags);
> +	if (q->mq_ops)
> +		blk_mq_run_queues(q, 0);
> +	else {
> +		unsigned long flags;
> +		spin_lock_irqsave(q->queue_lock, flags);
> +		__blk_run_queue(q);
> +		spin_unlock_irqrestore(q->queue_lock, flags);
> +	}
>  }
>  EXPORT_SYMBOL(blk_run_queue);
>  

OK, after playing with QEMU AHCI + TYPE_ROM emulation recently to test
your series I can now RO mount an ISO image with a subset of the
patches.  That, plus some minor QEMU atapi.c hacks make cdrom.c do it's
thing.

Btw, I've encountered a QEMU ahci emulation CHECK_CONDITION exception
hangswith scsi-mq, which are due to the current lack of scsi-eh support
which libata depends upon to complete these failed commands.  (Currently
avoiding this bug with QEMU atapi hacks..)

AFAICT this particular patch doesn't seem to be required to make basic
QEMU AHCI emulation work with GOOD or CHECK_CONDITION status.  Just
curious, do you have a particular case with hw AHCI + TYPE_ROM where
this is strictly required..?

Thank you,

--nab


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

end of thread, other threads:[~2013-12-23  6:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-29  8:41 [PATCH 1/6] block: support blk-mq on blk_run_queue/blk_run_queue_async majianpeng
2013-12-23  6:27 ` Nicholas A. Bellinger

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