Re: [PATCH v2 2/2] nvme-multipath: don't wait for a grace period in nvme_mpath_set_live()
From: Nilay Shroff
Date: Thu Nov 12 2026 - 12:16:21 EST
On 11/11/26 6:40 PM, Qiliang Yuan wrote:
When a path goes live, nvme_mpath_set_live() waits for an SRCU grace
period of the namespace head before kicking the requeue work, so that
bios which found no usable path are on the requeue list by the time it
runs.
The ANA work calls nvme_mpath_set_live() for every namespace that
becomes optimized or non-optimized, one after another, so an ANA change
waits for one grace period per namespace.
Start the grace period with start_poll_synchronize_srcu() instead and
have nvme_requeue_work() wait for it only if it has not completed yet.
Take the cookie under head->lock, so that concurrent callers store
their cookies in order and the requeue work never sees an older one.
The grace periods of all namespaces then run in parallel, and requeue
work kicked for other reasons finds the cookie completed and does not
wait.
Flipping an ANA group from inaccessible to optimized ten times over
nvme-tcp loopback, nvme_read_ana_log() takes (median, min-max in
parentheses):
namespaces before (ms) after (ms) change
256 51.9 (42.5-85.4) 8.9 (2.6-12.0) -83%
1024 157.5 (133.5-179.6) 49.5 (32.8-67.1) -69%
Signed-off-by: Qiliang Yuan<qiliang.yuan@xxxxxxxxx>
Looks good to me:
Reviewed-by: Nilay Shroff <nilay@xxxxxxxxxxxxx>