OSDN Git Service

blk-mq: init hctx sched after update ctx and hctx mapping
authorJianchao Wang <jianchao.w.wang@oracle.com>
Tue, 21 Aug 2018 07:15:03 +0000 (15:15 +0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 21 Aug 2018 15:02:55 +0000 (09:02 -0600)
commitd48ece209f82c9ce07be942441b53d3fa3664936
treeddf957d9d4edf1915558bc528fee6696cc02f1ed
parentfcedba42d94ecdc14ca13d3797cba1ccbf743fa4
blk-mq: init hctx sched after update ctx and hctx mapping

Currently, when update nr_hw_queues, IO scheduler's init_hctx will
be invoked before the mapping between ctx and hctx is adapted
correctly by blk_mq_map_swqueue. The IO scheduler init_hctx (kyber)
may depend on this mapping and get wrong result and panic finally.
A simply way to fix this is that switch the IO scheduler to 'none'
before update the nr_hw_queues, and then switch it back after
update nr_hw_queues. blk_mq_sched_init_/exit_hctx are removed due
to nobody use them any more.

Signed-off-by: Jianchao Wang <jianchao.w.wang@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq-sched.c
block/blk-mq-sched.h
block/blk-mq.c
block/blk.h
block/elevator.c