[PATCH 1/3] nvme-multipath: simplify loop in nvme_update_ana_state()
Keith Busch
kbusch at kernel.org
Mon Oct 7 08:46:16 PDT 2024
On Mon, Oct 07, 2024 at 12:01:32PM +0200, Hannes Reinecke wrote:
> Currently nvme_update_ana_state() iterates over all namespaces
> with the srcu lock held, and calls the 'cb' function if a
> match on the list of namespaces from the ANA log is found.
> This assumes that the iteration itself is relatively quick,
> and the namespace state itself doesn't change during iteration.
> For more complex functions (eg if the 'cb' function triggers
> mpath_set_live() which then kicks off a partition scan) the
> namespace state might change while iterating, and the rcu-protected
> area becomes really long.
> So change the loop to iterated over the entries in the ANA log,
> and call nvme_find_get_ns() on each entry.
> With that the 'cb' function is executed outside of the RCU
> protected area, and normal reference counting rules apply.
This patch looks good to me.
Your commit log is word wrapping a bit short, though. We standardize on
72 characters.
More information about the Linux-nvme
mailing list