[PATCH v2 2/2] nvme-multipath: don't wait for a grace period in nvme_mpath_set_live()
Nilay Shroff
nilay at linux.ibm.com
Thu Nov 12 08:47:26 PST 2026
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 at linux.dev>
Looks good to me:
Reviewed-by: Nilay Shroff <nilay at linux.ibm.com>
More information about the Linux-nvme
mailing list