Skip to content

Commit dbd3bbd

Browse files
snitmaxboe
authored andcommitted
dm rq: leverage blk_mq_queue_busy() to check for outstanding IO
Now that request-based dm-multipath only supports blk-mq, make use of the newly introduced blk_mq_queue_busy() to check for outstanding IO -- rather than (ab)using the block core's in_flight counters. Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 80a787b commit dbd3bbd

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/md/dm-rq.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,11 @@ static void rq_end_stats(struct mapped_device *md, struct request *orig)
130130
*/
131131
static void rq_completed(struct mapped_device *md, int rw, bool run_queue)
132132
{
133-
atomic_dec(&md->pending[rw]);
134-
135133
/* nudge anyone waiting on suspend queue */
136-
if (!md_in_flight(md))
137-
wake_up(&md->wait);
134+
if (unlikely(waitqueue_active(&md->wait))) {
135+
if (!blk_mq_queue_busy(md->queue))
136+
wake_up(&md->wait);
137+
}
138138

139139
/*
140140
* dm_put() must be at the end of this function. See the comment above
@@ -436,7 +436,6 @@ ssize_t dm_attr_rq_based_seq_io_merge_deadline_store(struct mapped_device *md,
436436
static void dm_start_request(struct mapped_device *md, struct request *orig)
437437
{
438438
blk_mq_start_request(orig);
439-
atomic_inc(&md->pending[rq_data_dir(orig)]);
440439

441440
if (unlikely(dm_stats_used(&md->stats))) {
442441
struct dm_rq_target_io *tio = tio_from_request(orig);

0 commit comments

Comments
 (0)