All of lore.kernel.org
 help / color / mirror / Atom feed
From: keith.busch@intel.com (Keith Busch)
Subject: gain NVMe SQ in-flight entries #
Date: Fri, 8 Jul 2016 19:22:20 -0400	[thread overview]
Message-ID: <20160708232219.GA28530@localhost.localdomain> (raw)
In-Reply-To: <CANr0WEfCecCG4FKYtpdHxavj5AJGu+D2e2QsLwKe_77fKd-_yg@mail.gmail.com>

On Fri, Jul 08, 2016@06:03:33PM -0500, Huaicheng Li wrote:
> Hi all,
> 
> (1). When nvme_queue_rq() queues a new I/O to the SQ, why doesn't it
> check whether the SQ is full or not?

It can never be full. We don't preallocate enough tags to fill it.

> Similarly, when nvme_process_rq() handles a CQE, it seems not checking
> whether CQ is empty? Why is that?

Huh? We check the phase bits to know if there's a new entry.

> (2). Why does nvme_queue_rq() need to call __nvme_process_cq()?? That
> should be the job of interrupt handler or poll().
> Anything missing here?

It's a micro optimization. We already hold the queue lock, might as well
opprotunistically see if there's any work completed. Worst case scenario
is nothing happens.

> (3). Is there an easy way to figure out how many entries are in the
> SQ? 

You can see how many are active on any given queue by reading the "tags"
file under /sys/block/nvmeXnY/mq/<queue>/tags

The tags are shared among multiple namespaces, so you only need to
query one's mq tags file see how many are active.

> We can know where SQ_tail is in nvme_queue structure, how can the
> host know where the queue's head is **immediately**?

The host doesn't really know where the SQ head is. Only the controller
knows that, though it does provide a hint on each completion queue entry
where it was at the time the CQE was posted.

Assuming you mean the SQ tail, you can't view that without writing some
additional code to expose this to a user. But why do you even want to
know this?

  reply	other threads:[~2016-07-08 23:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-08 23:03 gain NVMe SQ in-flight entries # Huaicheng Li
2016-07-08 23:22 ` Keith Busch [this message]
2016-07-09  0:16   ` Huaicheng Li (coperd)

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=20160708232219.GA28530@localhost.localdomain \
    --to=keith.busch@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.