linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHSET 0/2] Add queue_is_busy helper
@ 2018-11-08 15:42 Jens Axboe
  2018-11-08 15:42 ` [PATCH 1/2] blk-mq-tag: change busy_iter_fn to return whether to continue or not Jens Axboe
  2018-11-08 15:42 ` [PATCH 2/2] blk-mq: provide a helper to check if a queue is busy Jens Axboe
  0 siblings, 2 replies; 10+ messages in thread
From: Jens Axboe @ 2018-11-08 15:42 UTC (permalink / raw)
  To: linux-block

DM currently uses atomic inc/dec to maintain a busy count of
IO on a given device. For the dm-mq path, we can replace this
with helper that just checks the state of the tags on the device.

First patch is a prep patch that allows the iteration helpers
to return true/false, like we support internally in sbitmap.
For a busy check we don't care about how many requests are
busy, just if some are or not. Hence we can stop iterating
tags as soon as we find one that is allocated.


 block/blk-mq-debugfs.c |  4 +++-
 block/blk-mq-tag.c     |  4 ++--
 block/blk-mq.c         | 38 +++++++++++++++++++++++++++++++++-----
 include/linux/blk-mq.h |  6 ++++--
 4 files changed, 42 insertions(+), 10 deletions(-)

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 10+ messages in thread
* [PATCHSET v2 0/2] Add queue_is_busy helper
@ 2018-11-08 16:06 Jens Axboe
  2018-11-08 16:06 ` [PATCH 2/2] blk-mq: provide a helper to check if a queue is busy Jens Axboe
  0 siblings, 1 reply; 10+ messages in thread
From: Jens Axboe @ 2018-11-08 16:06 UTC (permalink / raw)
  To: linux-block

DM currently uses atomic inc/dec to maintain a busy count of
IO on a given device. For the dm-mq path, we can replace this
with helper that just checks the state of the tags on the device.

First patch is a prep patch that allows the iteration helpers
to return true/false, like we support internally in sbitmap.
For a busy check we don't care about how many requests are
busy, just if some are or not. Hence we can stop iterating
tags as soon as we find one that is allocated.

Changes since v1:

- Remember to check if the queue matches, otherwise we could be
  returning false positive for shared tag sets.

 block/blk-mq-debugfs.c |  4 +++-
 block/blk-mq-tag.c     |  4 ++--
 block/blk-mq.c         | 42 +++++++++++++++++++++++++++++++++++++-----
 include/linux/blk-mq.h |  6 ++++--
 4 files changed, 46 insertions(+), 10 deletions(-)

-- 
Jens Axboe

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

end of thread, other threads:[~2018-11-08 16:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-08 15:42 [PATCHSET 0/2] Add queue_is_busy helper Jens Axboe
2018-11-08 15:42 ` [PATCH 1/2] blk-mq-tag: change busy_iter_fn to return whether to continue or not Jens Axboe
2018-11-08 15:48   ` Mike Snitzer
2018-11-08 15:42 ` [PATCH 2/2] blk-mq: provide a helper to check if a queue is busy Jens Axboe
2018-11-08 15:49   ` Mike Snitzer
2018-11-08 15:54   ` Laurence Oberman
2018-11-08 15:58     ` Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2018-11-08 16:06 [PATCHSET v2 0/2] Add queue_is_busy helper Jens Axboe
2018-11-08 16:06 ` [PATCH 2/2] blk-mq: provide a helper to check if a queue is busy Jens Axboe
2018-11-08 16:30   ` Bart Van Assche
2018-11-08 16:32     ` Jens Axboe

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