From: Ming Lei Date: Thu, 11 Nov 2021 08:51:33 +0000 (+0800) Subject: blk-mq: don't grab ->q_usage_counter in blk_mq_sched_bio_merge X-Git-Tag: v6.1-rc5~2626^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=10f7335e3627b4efa341ef8ac457f2c0770c5c19;p=platform%2Fkernel%2Flinux-starfive.git 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 Signed-off-by: Ming Lei Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211111085134.345235-2-ming.lei@redhat.com Signed-off-by: Jens Axboe --- diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c index 4be652f..ba21449 100644 --- a/block/blk-mq-sched.c +++ b/block/blk-mq-sched.c @@ -370,9 +370,6 @@ bool blk_mq_sched_bio_merge(struct request_queue *q, struct bio *bio, bool ret = false; enum hctx_type type; - if (bio_queue_enter(bio)) - return false; - if (e && e->type->ops.bio_merge) { ret = e->type->ops.bio_merge(q, bio, nr_segs); goto out_put; @@ -397,7 +394,6 @@ bool blk_mq_sched_bio_merge(struct request_queue *q, struct bio *bio, spin_unlock(&ctx->lock); out_put: - blk_queue_exit(q); return ret; }