blk-mq: add helper for checking if one CPU is mapped to specified hctx
authorMing Lei <ming.lei@redhat.com>
Fri, 17 May 2024 02:05:14 +0000 (10:05 +0800)
committerJens Axboe <axboe@kernel.dk>
Fri, 17 May 2024 15:40:26 +0000 (09:40 -0600)
commit7b815817aa58d2e2101feb2fcf64c60cae0b2695
tree697362701100e5e1714f5f792d9d55db8785bc43
parent9d230c09964e6e18c8f6e4f0d41ee90eef45ec1c
blk-mq: add helper for checking if one CPU is mapped to specified hctx

Commit a46c27026da1 ("blk-mq: don't schedule block kworker on isolated CPUs")
rules out isolated CPUs from hctx->cpumask, and hctx->cpumask should only be
used for scheduling kworker.

Add helper blk_mq_cpu_mapped_to_hctx() and apply it into cpuhp handlers.

This patch avoids to forget clearing INACTIVE of hctx state in case that one
isolated CPU becomes online, and fixes hang issue when allocating request
from this hctx's tags.

Cc: Raju Cheerla <rcheerla@redhat.com>
Fixes: a46c27026da1 ("blk-mq: don't schedule block kworker on isolated CPUs")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20240517020514.149771-1-ming.lei@redhat.com
Tested-by: Raju Cheerla <rcheerla@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq.c