stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] block: Make blk_mq_delay_kick_requeue_list() rerun the queue at a quiet time
@ 2017-08-09 18:28 Bart Van Assche
  2017-08-09 19:01 ` Jens Axboe
  2017-08-10  7:14 ` Christoph Hellwig
  0 siblings, 2 replies; 4+ messages in thread
From: Bart Van Assche @ 2017-08-09 18:28 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Christoph Hellwig, dm-devel, Bart Van Assche,
	Mike Snitzer, Laurence Oberman, stable

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()")
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Mike Snitzer <snitzer@redhat.com>
Cc: Laurence Oberman <loberman@redhat.com>
Cc: <stable@vger.kernel.org>
---
 block/blk-mq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 041f7b7fa0d6..8bfea36e92f9 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -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);
 
-- 
2.13.3

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

* Re: [PATCH] block: Make blk_mq_delay_kick_requeue_list() rerun the queue at a quiet time
  2017-08-09 18:28 [PATCH] block: Make blk_mq_delay_kick_requeue_list() rerun the queue at a quiet time Bart Van Assche
@ 2017-08-09 19:01 ` Jens Axboe
  2017-08-10  7:14 ` Christoph Hellwig
  1 sibling, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2017-08-09 19:01 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: linux-block, Christoph Hellwig, dm-devel, Mike Snitzer,
	Laurence Oberman, stable

On 08/09/2017 12:28 PM, Bart Van Assche wrote:
> 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.

-- 
Jens Axboe

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

* Re: [PATCH] block: Make blk_mq_delay_kick_requeue_list() rerun the queue at a quiet time
  2017-08-09 18:28 [PATCH] block: Make blk_mq_delay_kick_requeue_list() rerun the queue at a quiet time Bart Van Assche
  2017-08-09 19:01 ` Jens Axboe
@ 2017-08-10  7:14 ` Christoph Hellwig
  2017-08-10 15:14   ` Bart Van Assche
  1 sibling, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2017-08-10  7:14 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Jens Axboe, linux-block, Christoph Hellwig, dm-devel,
	Mike Snitzer, Laurence Oberman, stable

On Wed, Aug 09, 2017 at 11:28:06AM -0700, Bart Van Assche wrote:
> 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?

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

* Re: [PATCH] block: Make blk_mq_delay_kick_requeue_list() rerun the queue at a quiet time
  2017-08-10  7:14 ` Christoph Hellwig
@ 2017-08-10 15:14   ` Bart Van Assche
  0 siblings, 0 replies; 4+ messages in thread
From: Bart Van Assche @ 2017-08-10 15:14 UTC (permalink / raw)
  To: hch@lst.de
  Cc: dm-devel@redhat.com, loberman@redhat.com,
	linux-block@vger.kernel.org, stable@vger.kernel.org,
	axboe@kernel.dk, snitzer@redhat.com

On Thu, 2017-08-10 at 09:14 +0200, Christoph Hellwig wrote:
> On Wed, Aug 09, 2017 at 11:28:06AM -0700, Bart Van Assche wrote:
> > 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.

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

end of thread, other threads:[~2017-08-10 15:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-09 18:28 [PATCH] block: Make blk_mq_delay_kick_requeue_list() rerun the queue at a quiet time Bart Van Assche
2017-08-09 19:01 ` Jens Axboe
2017-08-10  7:14 ` Christoph Hellwig
2017-08-10 15:14   ` Bart Van Assche

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