Skip to content

Commit 10f7335

Browse files
Ming Leiaxboe
authored andcommitted
blk-mq: don't grab ->q_usage_counter in blk_mq_sched_bio_merge
blk_mq_sched_bio_merge is only called from blk-mq.c:blk_attempt_bio_merge(), which is called when queue usage counter is grabbed already: 1) blk_mq_get_new_requests() 2) blk_mq_get_request() - cached request in current plug owns one queue usage counter So don't grab ->q_usage_counter in blk_mq_sched_bio_merge(), and more importantly this nest way causes hang in blk_mq_freeze_queue_wait(). Cc: Christoph Hellwig <[email protected]> Signed-off-by: Ming Lei <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 438cd74 commit 10f7335

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

block/blk-mq-sched.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,9 +370,6 @@ bool blk_mq_sched_bio_merge(struct request_queue *q, struct bio *bio,
370370
bool ret = false;
371371
enum hctx_type type;
372372

373-
if (bio_queue_enter(bio))
374-
return false;
375-
376373
if (e && e->type->ops.bio_merge) {
377374
ret = e->type->ops.bio_merge(q, bio, nr_segs);
378375
goto out_put;
@@ -397,7 +394,6 @@ bool blk_mq_sched_bio_merge(struct request_queue *q, struct bio *bio,
397394

398395
spin_unlock(&ctx->lock);
399396
out_put:
400-
blk_queue_exit(q);
401397
return ret;
402398
}
403399

0 commit comments

Comments
 (0)