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, 30 Mar 2015 18:54:44 +0000 (12:54 -0600)
commita9421f8dcf1d8b78c803791f3f5bdaa348b28e10
tree59f683baada39ae8215aef8404d473bd463e8d6f
parente0cd1cdc9d17cf13e9ddf5eb2698caf85cdf93fb
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