Skip to content

Commit 10845a1

Browse files
Cong Zhangaxboe
authored andcommitted
blk-mq: skip CPU offline notify on unmapped hctx
If an hctx has no software ctx mapped, blk_mq_map_swqueue() never allocates tags and leaves hctx->tags NULL. The CPU hotplug offline notifier can still run for that hctx, return early since hctx cannot hold any requests. Signed-off-by: Cong Zhang <cong.zhang@oss.qualcomm.com> Fixes: bf0beec ("blk-mq: drain I/O when all CPUs in a hctx are offline") Reviewed-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent a2ce133 commit 10845a1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

block/blk-mq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3721,7 +3721,7 @@ static int blk_mq_hctx_notify_offline(unsigned int cpu, struct hlist_node *node)
37213721
struct blk_mq_hw_ctx, cpuhp_online);
37223722
int ret = 0;
37233723

3724-
if (blk_mq_hctx_has_online_cpu(hctx, cpu))
3724+
if (!hctx->nr_ctx || blk_mq_hctx_has_online_cpu(hctx, cpu))
37253725
return 0;
37263726

37273727
/*

0 commit comments

Comments
 (0)