All of lore.kernel.org
 help / color / mirror / Atom feed
From: willy@linux.intel.com (Matthew Wilcox)
Subject: Questions on Interruption handling
Date: Fri, 24 Oct 2014 13:49:31 -0400	[thread overview]
Message-ID: <20141024174931.GT11522@wil.cx> (raw)
In-Reply-To: <CAMjVwgS5sv=rBS+FNSh7Np0Jn=uge9k00-3XLZ3M0=i0LEcjKw@mail.gmail.com>

On Fri, Oct 24, 2014@01:51:59PM -0300, Angelo Brito wrote:
> We can look more carefuly at those functions you stated, but perhaps
> there is a small difference on how we are reading the spec. We do not
> send a MSI for every single CQ because the spec states a different
> functionality in section 7.5.1. It defines that the internal IS vector
> should have a bit high when there are unanswered CQ entries and the
> vector is not masked. The table then states that the MSI should be
> sent only when a bit in the IS vector rises, meaning it either had
> entries and was unmasked or it did not have entries and an entry came
> in. I presume that was to reduce traffic in a very overloaded system.
> This is for MSI and legacy only, of course, MSI-X uses a different
> mechanism.
> 
> Now, there is a window that we noticed. After the interrupt was
> triggered it starts reading the CQs. It takes a few hundred
> nanoseconds from the time the CQs have been read to the time the
> doorbell arives at the controller, and the controller will take time
> to process it as well, probably up to a few microsencods. If the
> controller decides to write a new entry in a CQ in this time the
> corresponding bit in the IS vector will already be high, therefore
> there should be no new MSI. The host though already checked the CQs so
> it will not see that new entries came in.
> 
> We believe that is why section 7.5.1.1 states that the host should
> mask interrupts and then release them. This way the host forces the
> bits in the IS vector in the controller to go low and high again (see
> section 7.5.1). If the host did not answer every single CQ entry, then
> when the INTMC register is written a new MSI will be issued.

Argh, the spec is buggy.  It should say that if the CQ doorbell write is
less than the controller's notion of the CQ head, that the controller
should send another interrupt.  I've sent in a request to the NVMe
workgroup that we do an ECN to fix this.

  reply	other threads:[~2014-10-24 17:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-22 17:43 Questions on Interruption handling Angelo Brito
2014-10-22 18:10 ` Keith Busch
2014-10-23 13:30   ` Angelo Brito
2014-10-23 14:26   ` Angelo Brito
2014-10-23 16:53 ` Matthew Wilcox
2014-10-24 16:51   ` Angelo Brito
2014-10-24 17:49     ` Matthew Wilcox [this message]
2014-10-24 17:59       ` Angelo Brito
2015-01-20 19:13         ` Angelo Brito
2015-01-20 22:35           ` Keith Busch
2015-01-21  0:08             ` Angelo Brito

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=20141024174931.GT11522@wil.cx \
    --to=willy@linux.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.