blk-mq: cpu hot plug/unplug fixes new-queue-20130523
authorShaohua Li <shli@fusionio.com>
Wed, 22 May 2013 08:31:20 +0000 (10:31 +0200)
committerJens Axboe <axboe@kernel.dk>
Thu, 23 May 2013 11:12:49 +0000 (13:12 +0200)
commit816d743eb5f8ee1fb1ded3da3f14249790b17c2f
tree1b06d33830f7ac9556d181403c915bbc553306a1
parent2e3baca580617b2dac1283685454fb9df6820355
blk-mq: cpu hot plug/unplug fixes

The requests belonging to offline CPU could be in several stages:

1. in ctx->rq_list. blk_mq_hctx_notify() handles them.
2. in plug flush list. preemption doesn't flush plug list. So we need check if
requests are in online cpu queue.
3. dispatching list. Doesn't matter if requests are in online cpu queue.
4. end_io. we need check if ipi target is online cpu.

To fully support cpuhotplug, we need re-initialize cpu-hctx mapping, some data
structure must be re-initialized too. This is a bit challenging because there
might be request pending/running (we need a mechanism to free the queue for
example). So we just initialize all data structures staticlly (at queue init
time). If CPU is offline, it will be mapped to the first hard queue. In the
future, we need better cpuhotplug handling.

Signed-off-by: Shaohua Li <shli@fusionio.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq-cpumap.c
block/blk-mq.c