public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: John Levon <levon@movementarian.org>
To: Keith Busch <kbusch@kernel.org>
Cc: linux-nvme@lists.infradead.org, hch@lst.de, sagi@grimberg.me
Subject: Re: [PATCHv2 2/2] nvme-pci: remove cached shadow doorbell offsets
Date: Thu, 14 Oct 2021 19:33:57 +0100	[thread overview]
Message-ID: <YWh4FYa7TNEfdUj6@movementarian.org> (raw)
In-Reply-To: <20211014174938.GC1821373@dhcp-10-100-145-180.wdc.com>

On Thu, Oct 14, 2021 at 10:49:38AM -0700, Keith Busch wrote:

> On Thu, Oct 14, 2021 at 06:09:30PM +0100, John Levon wrote:
> > On Thu, Oct 14, 2021 at 09:45:43AM -0700, Keith Busch wrote:
> > 
> > > And when this feature is in use, the specification requires all queue
> > > updates use this mechanism, so don't don't treat the admin queue
> > > differently.
> > 
> > This would cause implementation difficulties for a controller, right?
> 
> If the controller is not maintaining the admin queue shadow, then the
> event index will always tell the host to ring the doorbell, right? So
> the same host behvaior would ultimately happen.

The eventidx only causes the additional BAR0 writes if the doorbell update
crosses it (for example, a 4->6 transition when host sees eventidx of 5). So we
couldn't just leave eventidx at zero, and neither can we maintain it to force
BAR0 writes, as there are races that means we'd have to look at the shadow
doorbell value - and make assumptions - anyway.

This would all be a lot easier if zero wasn't a valid doorbell value, but we're
stuck now.

> > Currently we presume that the admin queue's shadow doorbells aren't valid, so
> > always look at the BAR0 location. Given we need to support older Linux versions,
> > we don't have any non-hacky way to handle this: we'd need something horrible
> > that presumes those Linux versions - and any other driver implementations -
> > always leave the admin queue shadows at zero, so if we see a non-zero value, it
> > must be doing shadow doorbells.
> > 
> > It's unclear to me what the advantage of fixing this is, given Linux has been
> > out of spec for so long.
> 
> Ah, I skimmed the part that said we are not up to spec compliance, so
> aligning with the spec with any feature usually justifies itself. I see
> your point was the opposite :)

Exactly. The test SPDK client is out of spec in exactly the same way.

I'm trying to follow up on the spec side so it reflects reality (I can't find a
driver that behaves differently here), but that's obviously a slow process.

thanks
john


      reply	other threads:[~2021-10-14 18:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-14 16:45 [PATCHv2 0/2] nvme shadow doorbel buf fixes Keith Busch
2021-10-14 16:45 ` [PATCHv2 1/2] nvme-pci: clear shadow doorbell memory on resets Keith Busch
2021-10-14 21:21   ` John Levon
2021-10-20 17:23   ` Christoph Hellwig
2021-10-14 16:45 ` [PATCHv2 2/2] nvme-pci: remove cached shadow doorbell offsets Keith Busch
2021-10-14 16:53   ` Christoph Hellwig
2021-10-14 17:09   ` John Levon
2021-10-14 17:49     ` Keith Busch
2021-10-14 18:33       ` John Levon [this message]

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=YWh4FYa7TNEfdUj6@movementarian.org \
    --to=levon@movementarian.org \
    --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