Skip to contentSkip to conversation

block: Make blk_mq_delay_kick_requeue_list() rerun the queue at a quiet time

PATCH In review Bart Van Assche 3 participants 4 messages Aug 9, 2017 – Aug 10, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: Make blk_mq_delay_kick_requeue_list() rerun the queue at a quiet time

The blk_mq_delay_kick_requeue_list() function is used by the device mapper and only by the device mapper to rerun the queue and requeue list after a delay. This function is called once per request that gets requeued. Modify this function such that the queue is run once per path change event instead of once per request that is requeued.

Fixes commit 2849450ad39d ("blk-mq: introduce blk_mq_delay_kick_requeue_list()")
Cc Mike Snitzer <[email protected]>
Cc Laurence Oberman <[email protected]>
---
 block/blk-mq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
block/blk-mq.c +2 -2
index 041f7b7fa0d6..8bfea36e92f9 100644
@@ -679,8 +679,8 @@ EXPORT_SYMBOL(blk_mq_kick_requeue_list);
 void blk_mq_delay_kick_requeue_list(struct request_queue *q,
 				    unsigned long msecs)
 {
-	kblockd_schedule_delayed_work(&q->requeue_work,
-				      msecs_to_jiffies(msecs));
+	kblockd_mod_delayed_work_on(WORK_CPU_UNBOUND, &q->requeue_work,
+				    msecs_to_jiffies(msecs));
 }
 EXPORT_SYMBOL(blk_mq_delay_kick_requeue_list);
 
Signature · 1 line
2.13.3
maintainer
#1 lore raw
Quoted 5 lines · Bart Van Assche

The blk_mq_delay_kick_requeue_list() function is used by the device mapper and only by the device mapper to rerun the queue and requeue list after a delay. This function is called once per request that gets requeued. Modify this function such that the queue is run once per path change event instead of once per request that is requeued.

Looks good to me, will add for this series. Thanks Bart.

Signature · 1 line
Jens Axboe
#2 lore raw
In reply to Bart Van Assche
Quoted 5 lines · Bart Van Assche

The blk_mq_delay_kick_requeue_list() function is used by the device mapper and only by the device mapper to rerun the queue and requeue list after a delay. This function is called once per request that gets requeued. Modify this function such that the queue is run once per path change event instead of once per request that is requeued.

Is there a chance we could look into killing this function and moving dm to run it every time we requeue a request like all the other drivers?

#3 lore raw
Quoted 9 lines · Christoph Hellwig
Quoted 5 lines · Bart Van Assche

The blk_mq_delay_kick_requeue_list() function is used by the device mapper and only by the device mapper to rerun the queue and requeue list after a delay. This function is called once per request that gets requeued. Modify this function such that the queue is run once per path change event instead of once per request that is requeued.

Is there a chance we could look into killing this function and moving dm to run it every time we requeue a request like all the other drivers?

Hello Christoph,

That's an interesting question. I think it's not possible to remove this function without adding more infrastructure to the block layer. As an example, if the .lld_busy_fn() request queue callback function reports that a request queue is busy the only way for the dm-mpath driver to detect that an underlying request queue is no longer busy is by calling that function again after a certain time (see also multipath_busy() in dm-mpath.c). In other words, if we want to get rid of blk_mq_delay_kick_requeue_list() then notification mechanisms will have to be added for every type of state information that can cause the state of a multipath from "not ready" into "ready".

Bart.