blk-mq: fix potential stall during CPU unplug with IO pending
authorJens Axboe <axboe@fb.com>
Sat, 5 Apr 2014 03:34:48 +0000 (21:34 -0600)
committerJens Axboe <axboe@fb.com>
Mon, 7 Apr 2014 14:17:18 +0000 (08:17 -0600)
commitbccb5f7c8bdfe460d95f986c6edf2e75d8052897
tree7c745e10cab2c6cd91dbe2d8664601dda6d89a68
parent60b0ea120c80cba1cf5fe5ae82a35b1179263de3
blk-mq: fix potential stall during CPU unplug with IO pending

When a CPU is unplugged, we move the blk_mq_ctx request entries
to the current queue. The current code forgets to remap the
blk_mq_hw_ctx before marking the software context pending,
which breaks if old-cpu and new-cpu don't map to the same
hardware queue.

Additionally, if we mark entries as pending in the new
hardware queue, then make sure we schedule it for running.
Otherwise request could be sitting there until someone else
queues IO for that hardware queue.

Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-mq.c