Commit 10845a10 authored by Cong Zhang's avatar Cong Zhang Committed by Jens Axboe
Browse files

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: default avatarCong Zhang <cong.zhang@oss.qualcomm.com>
Fixes: bf0beec0 ("blk-mq: drain I/O when all CPUs in a hctx are offline")
Reviewed-by: default avatarMing Lei <ming.lei@redhat.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent a2ce1339
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3721,7 +3721,7 @@ static int blk_mq_hctx_notify_offline(unsigned int cpu, struct hlist_node *node)
			struct blk_mq_hw_ctx, cpuhp_online);
	int ret = 0;

	if (blk_mq_hctx_has_online_cpu(hctx, cpu))
	if (!hctx->nr_ctx || blk_mq_hctx_has_online_cpu(hctx, cpu))
		return 0;

	/*