blk-mq: cpu hot plug/unplug fixes
authorShaohua Li <shli@fusionio.com>
Wed, 22 May 2013 08:31:20 +0000 (10:31 +0200)
committerJens Axboe <axboe@kernel.dk>
Fri, 24 May 2013 18:22:58 +0000 (20:22 +0200)
commit3ceb968e46fdc5a3fa7516dc89e417be681aff46
tree16b56bb8533a2c4a841bad53375ab26a2e188703
parentde726562dabc4d3271d2be658298f7d7bbf6e9a7
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