All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2 0/3] nvme: sanitize KATO handling
@ 2021-03-02  9:26 Hannes Reinecke
  2021-03-02  9:26 ` [PATCH 1/3] nvme: fixup kato deadlock Hannes Reinecke
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Hannes Reinecke @ 2021-03-02  9:26 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Keith Busch, Sagi Grimberg, Daniel Wagner, linux-nvme,
	Hannes Reinecke, Chao Leng

Hi all,

one of our customer had been running into a deadlock trying to terminate
outstanding KATO commands during reset.
Looking closer at it, I found that we never actually _track_ if a KATO
command is submitted, so we might happily be sending several KATO commands
to the same controller simultaneously.
Also, I found it slightly odd that we signal a different KATO value to the
controller than what we're using internally; I would have thought that both
sides should agree on the same KATO value. And even that wouldn't be so
bad, but we really should be using the KATO value we annouonced to the
controller when setting the request timeout.

With these patches I attempt to resolve the situation; the first patch
ensures that only one KATO command to a given controller is outstanding.
With that the delay between sending KATO commands and the KATO timeout
are decoupled, and we can follow the recommendation from the base spec
to send the KATO commands at half the KATO timeout intervals.
And to aid userspace detecting persistent controllers we should be
displaying the KATO value in sysfs, too.

As usual, comments and reviews are welcome.

Changes to v1:
- Include reviews from Christoph
- Include reviews from Chao Leng
- Add new patch to display KATO value in sysfs

Hannes Reinecke (3):
  nvme: fixup kato deadlock
  nvme: sanitize KATO setting
  nvme: add 'kato' sysfs attribute

 drivers/nvme/host/core.c    | 21 ++++++++++++++++-----
 drivers/nvme/host/fabrics.c |  2 +-
 drivers/nvme/host/nvme.h    | 10 +++++++++-
 3 files changed, 26 insertions(+), 7 deletions(-)

-- 
2.29.2


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

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2021-03-08 13:56 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-02  9:26 [PATCHv2 0/3] nvme: sanitize KATO handling Hannes Reinecke
2021-03-02  9:26 ` [PATCH 1/3] nvme: fixup kato deadlock Hannes Reinecke
2021-03-03  8:42   ` Christoph Hellwig
2021-03-03 12:01     ` Hannes Reinecke
2021-03-03 12:35       ` Christoph Hellwig
2021-03-03 13:11         ` Hannes Reinecke
2021-03-03 14:23           ` Hannes Reinecke
2021-03-04  8:02             ` Christoph Hellwig
2021-03-04  8:56               ` Hannes Reinecke
2021-03-02  9:26 ` [PATCH 2/3] nvme: sanitize KATO setting Hannes Reinecke
2021-03-03  8:53   ` Chao Leng
2021-03-03 12:40     ` Christoph Hellwig
2021-03-05 20:38   ` Sagi Grimberg
2021-03-08 13:11   ` Max Gurtovoy
2021-03-08 13:54     ` Hannes Reinecke
2021-03-02  9:26 ` [PATCH 3/3] nvme: add 'kato' sysfs attribute Hannes Reinecke
2021-03-05 20:38   ` Sagi Grimberg
2021-03-08 13:06   ` Max Gurtovoy

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.