All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] nvme: NSHEAD_DISK_LIVE fixes
@ 2024-09-02 11:15 Hannes Reinecke
  2024-09-02 11:15 ` [PATCH 1/4] nvme-multipath: fixup typo when clearing DISK_LIVE Hannes Reinecke
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Hannes Reinecke @ 2024-09-02 11:15 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Sagi Grimberg, Keith Busch, linux-nvme, Hannes Reinecke

Hi all,

I'm have a testcase which does a repeated map/unmap of namespaces and
changing the UUID for each namespace after unmapping.
This leads to an unrecoverable system where the scanning processes
are stuck in 'device_add_disk()' waiting for I/O which will never come
as the I/O is doing ping-pong between the namespace (which cannot
do I/O as the path is inaccessible) and the ns_head (which is not
live and hence can't do I/O, either).
With this patchset (and the queue freeze patchset from hch) the problem
is resolved and the testcase runs without issues.
I see to get the testcase added to blktests.

As usual, comments and reviews are welcome.

Hannes Reinecke (4):
  nvme-multipath: fixup typo when clearing DISK_LIVE
  nvme-multipath: clear 'NVME_NSHEAD_DISK_LIVE' bit on shutdown
  nvme-multipath: check for NVME_NSHEAD_DISK_LIVE when selecting paths
  nvme: remove existing namespace on ID mismatch

 drivers/nvme/host/core.c      |  4 +++-
 drivers/nvme/host/multipath.c | 10 ++++++++--
 2 files changed, 11 insertions(+), 3 deletions(-)

-- 
2.35.3



^ permalink raw reply	[flat|nested] 12+ messages in thread
* [PATCHv3 0/4] nvme: NSHEAD_DISK_LIVE fixes
@ 2024-09-06  7:18 Hannes Reinecke
  2024-09-06  7:18 ` [PATCH 1/4] nvme-multipath: fixup typo when clearing DISK_LIVE Hannes Reinecke
  0 siblings, 1 reply; 12+ messages in thread
From: Hannes Reinecke @ 2024-09-06  7:18 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Sagi Grimberg, Keith Busch, linux-nvme, Hannes Reinecke

Hi all,

I'm having a testcase which repeatedly deletes namespaces on the target
and creates new namespaces, and aggressively re-using NSIDs for the
new namespaces.
To throw in more fun these namespaces are created on different nodes
in the cluster, where only the paths local to the cluster node are
active, and all other paths are inaccessible.

Essentially it's doing something like:

echo 0 > ${ns}/enable
rm ${ns}
<random delay>
mkdir ${ns}
echo "<dev>" > ${ns}/device_path
echo "<grpid>" > ${ns}/ana_grpid
uuidgen > ${ns}/device_uuid
echo 1 > ${ns}/enable

repeatedly with several namespaces and several ANA groups.
This leads to an unrecoverable system where the scanning processes
are stuck in the partition scanning code triggered via
'device_add_disk()' waiting for I/O which will never
come.
There are two parts to fixing this:
We need to ensure the NSHEAD_DISK_LIVE is properly set when the
ns_head is live, and unset when the last path is gone.
And we need to trigger the requeue list after NSHEAD_DISK_LIVE
has been cleared to flush all outstanding I/O.

Turns out there's another corner case; when running the same test
but not removing the namespaces while changing the UUID we end up
with I/Os constantly being retried, and we are unable to even
disconnect the controller. To fix this we should set the
'failfast' flag for the controller when disconnecting to ensure
that all I/O is aborted.

With these patches (and the queue freeze patchset from hch) the problem
is resolved and the testcase runs without issues.
I see to get the testcase added to blktests.

As usual, comments and reviews are welcome.

Changes to v2:
- Include reviews from Sagi
- Drop the check for NSHEAD_DISK_LIVE in nvme_available_path()
- Add a patch to requeue I/O if the ANA state changed
- Set the 'failfast' flag when removing controllers

Changes to the original submission:
- Drop patch to remove existing namespaces on ID mismatch
- Combine patches updating NSHEAD_DISK_LIVE handling
- requeue I/O after NSHEAD_DISK_LIVE has been cleared

Hannes Reinecke (4):
  nvme-multipath: fixup typo when clearing DISK_LIVE
  nvme-multipath: check for NVME_NSHEAD_DISK_LIVE when selecting paths
  nvme-multipath: always requeue I/O when updating the ANA state
  nvme: set 'failfast_expired' in nvme_remove_namespaces()

 drivers/nvme/host/core.c      |  7 +++++++
 drivers/nvme/host/multipath.c | 23 +++++++++++++++++------
 2 files changed, 24 insertions(+), 6 deletions(-)

-- 
2.35.3



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

end of thread, other threads:[~2024-09-06  7:39 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-02 11:15 [PATCH 0/4] nvme: NSHEAD_DISK_LIVE fixes Hannes Reinecke
2024-09-02 11:15 ` [PATCH 1/4] nvme-multipath: fixup typo when clearing DISK_LIVE Hannes Reinecke
2024-09-02 16:48   ` Sagi Grimberg
2024-09-02 11:15 ` [PATCH 2/4] nvme-multipath: clear 'NVME_NSHEAD_DISK_LIVE' bit on shutdown Hannes Reinecke
2024-09-02 16:51   ` Sagi Grimberg
2024-09-02 11:15 ` [PATCH 3/4] nvme-multipath: check for NVME_NSHEAD_DISK_LIVE when selecting paths Hannes Reinecke
2024-09-02 16:53   ` Sagi Grimberg
2024-09-02 11:15 ` [PATCH 4/4] nvme: remove existing namespace on ID mismatch Hannes Reinecke
2024-09-02 17:01   ` Sagi Grimberg
2024-09-03 12:30     ` Hannes Reinecke
  -- strict thread matches above, loose matches on Subject: below --
2024-09-06  7:18 [PATCHv3 0/4] nvme: NSHEAD_DISK_LIVE fixes Hannes Reinecke
2024-09-06  7:18 ` [PATCH 1/4] nvme-multipath: fixup typo when clearing DISK_LIVE Hannes Reinecke
2024-09-06  7:29   ` Sagi Grimberg

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.