linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Vaibhav Nagarnaik <vnagarnaik@google.com>
To: Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@fb.com>,
	Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>
Cc: linux-nvme@lists.infradead.org,
	Bart Van Assche <bvanassche@google.com>,
	Eric Gouriou <egouriou@google.com>,
	Abbas Companywala <acompany@google.com>,
	"Mihai R." <dizzy@google.com>
Subject: NVMe PCI driver ignores SQHD from completion entries
Date: Fri, 4 Oct 2019 11:27:30 -0700	[thread overview]
Message-ID: <CAL26m8+WdjrKvnXDZdP4d2ekznfORDUV2Td6U6-DY9gcOqoOUA@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1251 bytes --]

Hello

According to NVMe spec:
A Submission Queue entry has been consumed by the controller when a
Completion Queue entry is posted that indicates that the Submission
Queue Head Pointer has moved past the slot in which that Submission
Queue entry was placed.

Which means, the driver needs to verify SQ Head Pointer value reported
in the completion entries before considering a particular SQ entry
reusable. Otherwise it's undefined behavior.

However, the NVMe PCI driver (up to and including v5.3.2) does not
respect this value. Abbas (cc'd here) verified that entries that are
pending on the controller will be overwritten by the driver if there
are enough block requests.

Practically speaking, this is probably not an issue for most
controllers since they would start processing the NVMe command as soon
as possible. And then never look at the entry again.

Is this considered spec violation? And if so, is it worth providing a
fix for it?

Keeping in mind, that a particularly long running NVMe command will
not allow some controllers to move SQ Head value. Even though the
subsequent NVMe commands have received completions earlier. This will
cause new block requests from being submitted until the long running
command is completed.


Vaibhav

[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4851 bytes --]

[-- Attachment #2: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

             reply	other threads:[~2019-10-04 18:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-04 18:27 Vaibhav Nagarnaik [this message]
2019-10-05 14:27 ` NVMe PCI driver ignores SQHD from completion entries Keith Busch
2019-10-08  0:32   ` Vaibhav Nagarnaik
2019-10-08 15:59     ` Keith Busch
2019-10-08 17:45       ` James Smart

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=CAL26m8+WdjrKvnXDZdP4d2ekznfORDUV2Td6U6-DY9gcOqoOUA@mail.gmail.com \
    --to=vnagarnaik@google.com \
    --cc=acompany@google.com \
    --cc=axboe@fb.com \
    --cc=bvanassche@google.com \
    --cc=dizzy@google.com \
    --cc=egouriou@google.com \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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 NNTP newsgroup(s).