block: do not put mq context in blk_mq_alloc_request_hctx
PATCH 1/1 block: do not put mq context in blk_mq_alloc_request_hctx
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 Sagi Grimberg <[email protected]>
Cc Omar Sandoval <[email protected]>
Cc Jens Axboe <[email protected]>
Signed-off-by Minchan Kim <[email protected]>
---
Maybe, it would be fixed by someone but I have noticed preempt counter undeflow problem a few weeks ago and still see the problem with linux-next.
block/blk-mq.c | 1 - 1 file changed, 1 deletion(-)
block/blk-mq.c +0 -1
@@ -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)
Signature · 1 line
2.7.4
Looks good,
Reviewed-by Sagi Grimberg <[email protected]>
Quoted 3 lines · Minchan Kim
In
blk_mq_alloc_request_hctx,blk_mq_sched_get_requestdoesn't get sw context so we don't need to put the context withblk_mq_put_ctx. Unless, we will see preempt counter underflow.
Good catch, that's definitely a bug. I have applied your patch for 4.11.
Signature · 1 line
Jens Axboe