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>