[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20200203091602.GA31450@ming.t460p>
Date: Mon, 3 Feb 2020 17:16:02 +0800
From: Ming Lei <ming.lei@...hat.com>
To: Hillf Danton <hdanton@...a.com>
Cc: linux-block@...r.kernel.org, Jens Axboe <axboe@...com>,
Ming Lin <ming.l@....samsung.com>,
Christoph Hellwig <hch@...radead.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] blk-mq: fix selecting software ctx for request
On Sun, Feb 02, 2020 at 06:20:04PM +0800, Hillf Danton wrote:
>
> Select the current cpu if it's mapped to hardware to make helpers like
> blk_mq_rq_cpu() return correct value.
>
> Signed-off-by: Hillf Danton <hdanton@...a.com>
> ---
>
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -454,7 +454,10 @@ struct request *blk_mq_alloc_request_hct
> blk_queue_exit(q);
> return ERR_PTR(-EXDEV);
> }
> - cpu = cpumask_first_and(alloc_data.hctx->cpumask, cpu_online_mask);
> + cpu = raw_smp_processor_id();
> + if (!cpumask_test_cpu(cpu, alloc_data.hctx->cpumask))
> + cpu = cpumask_first_and(alloc_data.hctx->cpumask,
> + cpu_online_mask);
How can you know if there is any online CPU available for this hctx?
> alloc_data.ctx = __blk_mq_get_ctx(q, cpu);
>
> rq = blk_mq_get_request(q, NULL, &alloc_data);
>
It is really one NVMe specific issue, see the following discussion:
https://lore.kernel.org/linux-block/8f4402a0-967d-f12d-2f1a-949e1dda017c@grimberg.me/#r
Thanks,
Ming
Powered by blists - more mailing lists