From: Keith Busch <kbusch@kernel.org>
To: John Meneghini <jmeneghi@redhat.com>
Cc: tj@kernel.org, josef@toxicpanda.com, axboe@kernel.dk, hch@lst.de,
sagi@grimberg.me, emilne@redhat.com, hare@kernel.org,
linux-block@vger.kernel.org, cgroups@vger.kernel.org,
linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org,
jrani@purestorage.com, randyj@purestorage.com
Subject: Re: [PATCH v4 1/6] nvme: multipath: Implemented new iopolicy "queue-depth"
Date: Mon, 20 May 2024 08:46:21 -0600 [thread overview]
Message-ID: <ZktiPV8h5y04YwXv@kbusch-mbp> (raw)
In-Reply-To: <20240514175322.19073-2-jmeneghi@redhat.com>
On Tue, May 14, 2024 at 01:53:17PM -0400, John Meneghini wrote:
> @@ -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);
Why skip passthrough and stats?
And I think you should squash the follow up patch that constrains the
atomics to the queue-depth path selector.
> +static struct nvme_ns *nvme_queue_depth_path(struct nvme_ns_head *head)
> +{
> + struct nvme_ns *best_opt = NULL, *best_nonopt = NULL, *ns;
> + unsigned int min_depth_opt = UINT_MAX, min_depth_nonopt = UINT_MAX;
> + unsigned int depth;
> +
> + list_for_each_entry_rcu(ns, &head->list, siblings) {
> + if (nvme_path_is_disabled(ns))
> + continue;
> +
> + depth = atomic_read(&ns->ctrl->nr_active);
> +
> + switch (ns->ana_state) {
> + case NVME_ANA_OPTIMIZED:
> + if (depth < min_depth_opt) {
> + min_depth_opt = depth;
> + best_opt = ns;
> + }
> + break;
> +
> + case NVME_ANA_NONOPTIMIZED:
> + if (depth < min_depth_nonopt) {
> + min_depth_nonopt = depth;
> + best_nonopt = ns;
> + }
> + break;
> + default:
> + break;
> + }
> + }
> +
I think you can do the atomic_inc here so you don't have to check the io
policy a 2nd time.
> + return best_opt ? best_opt : best_nonopt;
> +}
next prev parent reply other threads:[~2024-05-20 14:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-14 17:53 [PATCH v4 0/6] block,nvme: queue-depth and latency I/O schedulers John Meneghini
2024-05-14 17:53 ` [PATCH v4 1/6] nvme: multipath: Implemented new iopolicy "queue-depth" John Meneghini
2024-05-20 14:46 ` Keith Busch [this message]
2024-05-14 17:53 ` [PATCH v4 2/6] nvme: multipath: only update ctrl->nr_active when using queue-depth iopolicy John Meneghini
2024-05-14 17:53 ` [PATCH v4 3/6] nvme: multipath: Invalidate current_path when changing iopolicy John Meneghini
2024-05-14 17:53 ` [PATCH v4 4/6] block: track per-node I/O latency John Meneghini
2024-05-14 17:53 ` [PATCH v4 5/6] nvme: add 'latency' iopolicy John Meneghini
2024-05-14 17:53 ` [PATCH v4 6/6] nvme: multipath: pr_notice when iopolicy changes John Meneghini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZktiPV8h5y04YwXv@kbusch-mbp \
--to=kbusch@kernel.org \
--cc=axboe@kernel.dk \
--cc=cgroups@vger.kernel.org \
--cc=emilne@redhat.com \
--cc=hare@kernel.org \
--cc=hch@lst.de \
--cc=jmeneghi@redhat.com \
--cc=josef@toxicpanda.com \
--cc=jrani@purestorage.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=randyj@purestorage.com \
--cc=sagi@grimberg.me \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).