Re: [PATCH 1/1] block: System crashes when cpu hotplug + bouncing port
From: Daniel Wagner
Date: Mon Jun 28 2021 - 05:07:08 EST
Hi Wen,
On Sun, Jun 27, 2021 at 10:14:32PM -0500, wenxiong@xxxxxxxxxxxxxxxxxx wrote:
> @@ -468,8 +467,7 @@ struct request *blk_mq_alloc_request_hctx(struct request_queue *q,
> data.hctx = q->queue_hw_ctx[hctx_idx];
> if (!blk_mq_hw_queue_mapped(data.hctx))
> goto out_queue_exit;
> - cpu = cpumask_first_and(data.hctx->cpumask, cpu_online_mask);
> - data.ctx = __blk_mq_get_ctx(q, cpu);
> + data.ctx = __blk_mq_get_ctx(q, hctx_idx);
hctx_idx is just an index, not a CPU id. In this scenario, the hctx_idx
used to lookup the context happens to be valid. I am still a bit
confused why [1] doesn't work for this scenario.
As Ming pointed out in [2] we need to update cpumask for CPU hotplug
events.
Thanks,
Daniel
[1] https://lore.kernel.org/linux-block/20210608183339.70609-1-dwagner@xxxxxxx/
[2] https://lore.kernel.org/linux-nvme/YNXTaUMAFCA84jfZ@T590/