All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] blk-mq: kick requeue list in blk_mq_requeue_request()
@ 2014-06-10  4:52 Ming Lei
  2014-06-10 11:28 ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Ming Lei @ 2014-06-10  4:52 UTC (permalink / raw)
  To: Jens Axboe, linux-kernel
  Cc: Ming Lei, Matias Bjørling, Christoph Hellwig

blk_mq_requeue_request() should kick off the requeue list so
that the request can be scheduled to queue finally.

In nvme conversion patch, blk_mq_requeue_request() is called
to requeue failed request from completion handler, this patch
fixes the issue and makes the block API working as expected.

Cc: Matias Bjørling <m@bjorling.me>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
 block/blk-mq.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index cb4c785..4c78539 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -462,6 +462,7 @@ void blk_mq_requeue_request(struct request *rq)
 
 	BUG_ON(blk_queued_rq(rq));
 	blk_mq_add_to_requeue_list(rq, true);
+	blk_mq_kick_requeue_list(rq->q);
 }
 EXPORT_SYMBOL(blk_mq_requeue_request);
 
-- 
1.7.9.5


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

* Re: [PATCH] blk-mq: kick requeue list in blk_mq_requeue_request()
  2014-06-10  4:52 [PATCH] blk-mq: kick requeue list in blk_mq_requeue_request() Ming Lei
@ 2014-06-10 11:28 ` Christoph Hellwig
  2014-06-10 11:45   ` Ming Lei
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2014-06-10 11:28 UTC (permalink / raw)
  To: Ming Lei
  Cc: Jens Axboe, linux-kernel, Matias Bjørling, Christoph Hellwig

On Tue, Jun 10, 2014 at 12:52:05PM +0800, Ming Lei wrote:
> blk_mq_requeue_request() should kick off the requeue list so
> that the request can be scheduled to queue finally.
> 
> In nvme conversion patch, blk_mq_requeue_request() is called
> to requeue failed request from completion handler, this patch
> fixes the issue and makes the block API working as expected.

I've intentionally kepts the two separate so that we can batch operations
and just do a single kick for multiple requeued commands.


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

* Re: [PATCH] blk-mq: kick requeue list in blk_mq_requeue_request()
  2014-06-10 11:28 ` Christoph Hellwig
@ 2014-06-10 11:45   ` Ming Lei
  2014-06-10 12:45     ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Ming Lei @ 2014-06-10 11:45 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Jens Axboe, Linux Kernel Mailing List, Matias Bjørling

On Tue, Jun 10, 2014 at 7:28 PM, Christoph Hellwig <hch@lst.de> wrote:
> On Tue, Jun 10, 2014 at 12:52:05PM +0800, Ming Lei wrote:
>> blk_mq_requeue_request() should kick off the requeue list so
>> that the request can be scheduled to queue finally.
>>
>> In nvme conversion patch, blk_mq_requeue_request() is called
>> to requeue failed request from completion handler, this patch
>> fixes the issue and makes the block API working as expected.
>
> I've intentionally kepts the two separate so that we can batch operations
> and just do a single kick for multiple requeued commands.
>

OK, but the API name is a bit confusing, and that is easy to cause
misuse, like in nvme.

Also requeue one request in completion handler may be a
common case, so maybe it is better to let blk_mq_requeue_request()
handle both adding to request list and kicking off, and introduce
blk_mq_prep_requeue_req()(or better name) to batch operations.


Thanks,
-- 
Ming Lei

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

* Re: [PATCH] blk-mq: kick requeue list in blk_mq_requeue_request()
  2014-06-10 11:45   ` Ming Lei
@ 2014-06-10 12:45     ` Christoph Hellwig
  2014-06-10 14:47       ` Ming Lei
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2014-06-10 12:45 UTC (permalink / raw)
  To: Ming Lei; +Cc: Jens Axboe, Linux Kernel Mailing List, Matias Bjørling

On Tue, Jun 10, 2014 at 07:45:47PM +0800, Ming Lei wrote:
> OK, but the API name is a bit confusing, and that is easy to cause
> misuse, like in nvme.
> 
> Also requeue one request in completion handler may be a
> common case, so maybe it is better to let blk_mq_requeue_request()
> handle both adding to request list and kicking off, and introduce
> blk_mq_prep_requeue_req()(or better name) to batch operations.

For now please just add some documentation.  I'm happy to revisit
these once we have a few user in tree, but for now I'd like to keep
blk-mq a little more stable to not impact the merges of the major
users.

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

* Re: [PATCH] blk-mq: kick requeue list in blk_mq_requeue_request()
  2014-06-10 12:45     ` Christoph Hellwig
@ 2014-06-10 14:47       ` Ming Lei
  0 siblings, 0 replies; 5+ messages in thread
From: Ming Lei @ 2014-06-10 14:47 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Jens Axboe, Linux Kernel Mailing List, Matias Bjørling

On Tue, Jun 10, 2014 at 8:45 PM, Christoph Hellwig <hch@lst.de> wrote:
> On Tue, Jun 10, 2014 at 07:45:47PM +0800, Ming Lei wrote:
>> OK, but the API name is a bit confusing, and that is easy to cause
>> misuse, like in nvme.
>>
>> Also requeue one request in completion handler may be a
>> common case, so maybe it is better to let blk_mq_requeue_request()
>> handle both adding to request list and kicking off, and introduce
>> blk_mq_prep_requeue_req()(or better name) to batch operations.
>
> For now please just add some documentation.  I'm happy to revisit
> these once we have a few user in tree, but for now I'd like to keep
> blk-mq a little more stable to not impact the merges of the major
> users.

There are two users: one is nvme, another is scsi-mq, and both
don't need batch operations now.


Thanks,
-- 
Ming Lei

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

end of thread, other threads:[~2014-06-10 14:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-10  4:52 [PATCH] blk-mq: kick requeue list in blk_mq_requeue_request() Ming Lei
2014-06-10 11:28 ` Christoph Hellwig
2014-06-10 11:45   ` Ming Lei
2014-06-10 12:45     ` Christoph Hellwig
2014-06-10 14:47       ` Ming Lei

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.