[PATCH 1/3] nvme: multipath: Implemented new iopolicy "queue-depth"

Keith Busch kbusch at kernel.org
Tue Nov 7 13:49:39 PST 2023


On Tue, Nov 07, 2023 at 04:23:29PM -0500, Ewan D. Milne wrote:
>  void nvme_mpath_default_iopolicy(struct nvme_subsystem *subsys)
>  {
> @@ -130,6 +133,7 @@ void nvme_mpath_start_request(struct request *rq)
>  	if (!blk_queue_io_stat(disk->queue) || blk_rq_is_passthrough(rq))
>  		return;
>  
> +	atomic_inc(&ns->ctrl->nr_active);

Did you intend to skip counting nr_active if disk stats are not enabled,
or if it's a passthough command?

Also, we should restrict the atomics for other new IO Depth  policy.

>  	nvme_req(rq)->flags |= NVME_MPATH_IO_STATS;
>  	nvme_req(rq)->start_time = bdev_start_io_acct(disk->part0, req_op(rq),
>  						      jiffies);
> @@ -142,6 +146,8 @@ void nvme_mpath_end_request(struct request *rq)
>  
>  	if (!(nvme_req(rq)->flags & NVME_MPATH_IO_STATS))
>  		return;
> +
> +	atomic_dec(&ns->ctrl->nr_active);

And if disk stats were disabled, this dec isn't paired with an inc.



More information about the Linux-nvme mailing list