From: Minwoo Im <minwoo.im.dev@gmail.com>
To: Weiping Zhang <zhangweiping@didiglobal.com>
Cc: axboe@kernel.dk, tj@kernel.org, hch@lst.de, bvanassche@acm.org,
keith.busch@intel.com, minwoo.im.dev@gmail.com,
linux-block@vger.kernel.org, cgroups@vger.kernel.org,
linux-nvme@lists.infradead.org
Subject: Re: [PATCH v3 3/5] nvme-pci: rename module parameter write_queues to read_queues
Date: Tue, 25 Jun 2019 05:04:45 +0900 [thread overview]
Message-ID: <20190624200445.GB6526@minwooim-desktop> (raw)
In-Reply-To: <d61b1b9a31c3d2fae9ece26bcd5f4504b25f059f.1561385989.git.zhangweiping@didiglobal.com>
On 19-06-24 22:29:19, Weiping Zhang wrote:
> Now nvme support three type hardware queues, read, poll and default,
> this patch rename write_queues to read_queues to set the number of
> read queues more explicitly. This patch alos is prepared for nvme
> support WRR(weighted round robin) that we can get the number of
> each queue type easily.
>
> Signed-off-by: Weiping Zhang <zhangweiping@didiglobal.com>
Hello, Weiping.
Thanks for making this patch as a separated one. Actually I'd like to
hear about if the origin purpose of this param can be changed or not.
I can see a log from Jens when it gets added her:
Commit 3b6592f70ad7("nvme: utilize two queue maps, one for reads and
one for writes")
It says:
"""
NVMe does round-robin between queues by default, which means that
sharing a queue map for both reads and writes can be problematic
in terms of read servicing. It's much easier to flood the queue
with writes and reduce the read servicing.
"""
So, I'd like to hear what other people think about this patch :)
Thanks,
> ---
> drivers/nvme/host/pci.c | 22 ++++++++++------------
> 1 file changed, 10 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
> index 5d84241f0214..a3c9bb72d90e 100644
> --- a/drivers/nvme/host/pci.c
> +++ b/drivers/nvme/host/pci.c
> @@ -68,10 +68,10 @@ static int io_queue_depth = 1024;
> module_param_cb(io_queue_depth, &io_queue_depth_ops, &io_queue_depth, 0644);
> MODULE_PARM_DESC(io_queue_depth, "set io queue depth, should >= 2");
>
> -static int write_queues;
> -module_param(write_queues, int, 0644);
> -MODULE_PARM_DESC(write_queues,
> - "Number of queues to use for writes. If not set, reads and writes "
> +static int read_queues;
> +module_param(read_queues, int, 0644);
> +MODULE_PARM_DESC(read_queues,
> + "Number of queues to use for reads. If not set, reads and writes "
> "will share a queue set.");
>
> static int poll_queues;
> @@ -211,7 +211,7 @@ struct nvme_iod {
>
> static unsigned int max_io_queues(void)
> {
> - return num_possible_cpus() + write_queues + poll_queues;
> + return num_possible_cpus() + read_queues + poll_queues;
> }
>
> static unsigned int max_queue_count(void)
> @@ -2021,18 +2021,16 @@ static void nvme_calc_irq_sets(struct irq_affinity *affd, unsigned int nrirqs)
> * If only one interrupt is available or 'write_queue' == 0, combine
> * write and read queues.
> *
> - * If 'write_queues' > 0, ensure it leaves room for at least one read
> + * If 'read_queues' > 0, ensure it leaves room for at least one write
> * queue.
> */
> - if (!nrirqs) {
> + if (!nrirqs || nrirqs == 1) {
> nrirqs = 1;
> nr_read_queues = 0;
> - } else if (nrirqs == 1 || !write_queues) {
> - nr_read_queues = 0;
> - } else if (write_queues >= nrirqs) {
> - nr_read_queues = 1;
> + } else if (read_queues >= nrirqs) {
> + nr_read_queues = nrirqs - 1;
> } else {
> - nr_read_queues = nrirqs - write_queues;
> + nr_read_queues = read_queues;
> }
>
> dev->io_queues[HCTX_TYPE_DEFAULT] = nrirqs - nr_read_queues;
> --
> 2.14.1
>
next prev parent reply other threads:[~2019-06-24 20:04 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1561385989.git.zhangweiping@didiglobal.com>
2019-06-24 14:28 ` [PATCH v3 1/5] block: add weighted round robin for blkcgroup Weiping Zhang
2019-07-18 13:59 ` Tejun Heo
2019-07-23 14:29 ` Weiping Zhang
2019-06-24 14:29 ` [PATCH v3 2/5] nvme: add get_ams for nvme_ctrl_ops Weiping Zhang
2019-06-24 20:12 ` Minwoo Im
2019-06-25 14:46 ` Weiping Zhang
2019-06-24 14:29 ` [PATCH v3 3/5] nvme-pci: rename module parameter write_queues to read_queues Weiping Zhang
2019-06-24 20:04 ` Minwoo Im [this message]
2019-06-25 14:48 ` Weiping Zhang
2019-06-26 20:27 ` Minwoo Im
2019-06-24 14:29 ` [PATCH v3 4/5] genirq/affinity: allow driver's discontigous affinity set Weiping Zhang
2019-06-24 15:42 ` Thomas Gleixner
2019-06-25 2:14 ` Ming Lei
2019-06-25 6:13 ` Thomas Gleixner
2019-06-25 14:55 ` Weiping Zhang
2019-06-24 14:29 ` [PATCH v3 5/5] nvme: add support weighted round robin queue Weiping Zhang
2019-06-24 20:21 ` Minwoo Im
2019-06-25 15:06 ` Weiping Zhang
2019-06-27 10:37 ` Minwoo Im
2019-06-27 11:03 ` Christoph Hellwig
2019-06-28 15:57 ` Weiping Zhang
2019-07-10 14:20 ` Weiping Zhang
2019-07-29 10:22 ` Weiping Zhang
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=20190624200445.GB6526@minwooim-desktop \
--to=minwoo.im.dev@gmail.com \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=cgroups@vger.kernel.org \
--cc=hch@lst.de \
--cc=keith.busch@intel.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=tj@kernel.org \
--cc=zhangweiping@didiglobal.com \
/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