block: do not put mq context in blk_mq_alloc_request_hctx
authorMinchan Kim <minchan@kernel.org>
Thu, 30 Mar 2017 05:20:45 +0000 (14:20 +0900)
committerJens Axboe <axboe@fb.com>
Thu, 30 Mar 2017 14:13:23 +0000 (08:13 -0600)
In blk_mq_alloc_request_hctx, blk_mq_sched_get_request doesn't
get sw context so we don't need to put the context with
blk_mq_put_ctx. Unless, we will see preempt counter underflow.

Cc: Omar Sandoval <osandov@fb.com>
Signed-off-by: Minchan Kim <minchan@kernel.org>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-mq.c

index 6b6e7bc041dbf3c4699ca9bfa8e36c58a8f119d0..935f2cc7c8c3ae8b58d75e29c576bb7e88eb587a 100644 (file)
@@ -321,7 +321,6 @@ struct request *blk_mq_alloc_request_hctx(struct request_queue *q, int rw,
 
        rq = blk_mq_sched_get_request(q, NULL, rw, &alloc_data);
 
-       blk_mq_put_ctx(alloc_data.ctx);
        blk_queue_exit(q);
 
        if (!rq)