提交 793597a6 编写于 作者: C Christoph Hellwig 提交者: Jens Axboe

blk-mq: do not use blk_mq_alloc_request_pinned in blk_mq_map_request

We already do a non-blocking allocation in blk_mq_map_request, no need
to repeat it.  Just call __blk_mq_alloc_request to wait directly.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NJens Axboe <axboe@fb.com>
上级 a3bd7756
......@@ -1179,12 +1179,14 @@ static struct request *blk_mq_map_request(struct request_queue *q,
trace_block_getrq(q, bio, rw);
rq = __blk_mq_alloc_request(q, hctx, ctx, rw, GFP_ATOMIC, false);
if (unlikely(!rq)) {
__blk_mq_run_hw_queue(hctx);
blk_mq_put_ctx(ctx);
trace_block_sleeprq(q, bio, rw);
rq = blk_mq_alloc_request_pinned(q, rw, __GFP_WAIT|GFP_ATOMIC,
false);
ctx = rq->mq_ctx;
ctx = blk_mq_get_ctx(q);
hctx = q->mq_ops->map_queue(q, ctx->cpu);
rq = __blk_mq_alloc_request(q, hctx, ctx, rw,
__GFP_WAIT|GFP_ATOMIC, false);
}
hctx->queued++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册