From: Jens Axboe <axboe@kernel.dk>
To: Keith Busch <kbusch@kernel.org>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH] nvme: don't memset() the normal read/write command
Date: Tue, 12 Oct 2021 12:56:21 -0600 [thread overview]
Message-ID: <186c4aed-23eb-05f4-b310-0b0d091e2223@kernel.dk> (raw)
In-Reply-To: <20211012183107.GA636540@dhcp-10-100-145-180.wdc.com>
On 10/12/21 12:31 PM, Keith Busch wrote:
> On Tue, Oct 12, 2021 at 12:13:52PM -0600, Jens Axboe wrote:
>> This memset in the fast path costs a lot of cycles on my setup. Here's a
>> top-of-profile of doing ~6.7M IOPS:
>>
>> + 5.90% io_uring [nvme] [k] nvme_queue_rq
>> + 5.32% io_uring [nvme_core] [k] nvme_setup_cmd
>> + 5.17% io_uring [kernel.vmlinux] [k] io_submit_sqes
>> + 4.97% io_uring [kernel.vmlinux] [k] blkdev_direct_IO
>>
>> and a perf diff with this patch:
>>
>> 0.92% +4.40% [nvme_core] [k] nvme_setup_cmd
>>
>> reducing it from 5.3% to only 0.9%. This takes it from the 2nd most
>> cycle consumer to something that's mostly irrelevant.
>>
>> Retain the full clear for the other commands to avoid doing any audits
>> there, and just clear the fields in the rw command manually that we
>> don't already fill.
>
> Oo, we knew about this optimization *years* ago, yet didn't do anything
> about it! Better late than never.
>
> http://lists.infradead.org/pipermail/linux-nvme/2014-May/000837.html
Dang, 2014! Better late than never...
> Acked-by: Keith Busch <kbusch@kernel.org>
Added, thanks.
--
Jens Axboe
next prev parent reply other threads:[~2021-10-12 18:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-12 18:13 [PATCH] nvme: don't memset() the normal read/write command Jens Axboe
2021-10-12 18:31 ` Keith Busch
2021-10-12 18:56 ` Jens Axboe [this message]
2021-10-13 4:14 ` Chaitanya Kulkarni
2021-10-13 4:58 ` Christoph Hellwig
2021-10-18 10:22 ` Christoph Hellwig
2021-10-18 12:33 ` Jens Axboe
2021-10-18 12:37 ` Christoph Hellwig
2021-10-18 12:38 ` Jens Axboe
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=186c4aed-23eb-05f4-b310-0b0d091e2223@kernel.dk \
--to=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-block@vger.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