]> git.baikalelectronics.ru Git - kernel.git/commit
blk-mq: make sure that correct hctx->next_cpu is set
authorMing Lei <ming.lei@redhat.com>
Sun, 8 Apr 2018 09:48:07 +0000 (17:48 +0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 10 Apr 2018 14:38:46 +0000 (08:38 -0600)
commitde2e4a1d65a5dd6a3bc1aef95f73bb7dbfba1c8b
tree0ec9fdf86086885756ceecadb154c44eec8973bf
parenta2e3505f64b924db3522b4f61a0faefbd2b62d17
blk-mq: make sure that correct hctx->next_cpu is set

From commit 4ed8f55b5dcf8 (blk-mq: simplify queue mapping & schedule
with each possisble CPU), one hctx can be mapped from all offline CPUs,
then hctx->next_cpu can be set as wrong.

This patch fixes this issue by making hctx->next_cpu pointing to the
first CPU in hctx->cpumask if all CPUs in hctx->cpumask are offline.

Cc: Stefan Haberland <sth@linux.vnet.ibm.com>
Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Fixes: 4ed8f55b5dcf8 ("blk-mq: simplify queue mapping & schedule with each possisble CPU")
Cc: stable@vger.kernel.org
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq.c