[PATCH RFC] nvme-multipath: optimize path selection in queue-depth policy
Keith Busch
kbusch at kernel.org
Wed May 6 07:45:30 PDT 2026
On Wed, May 07, 2026 at 04:15:41PM +0200, Xose Vazquez Perez wrote:
> Move the zero-depth check inside the optimized path case to enable early
> exit. It avoids redundant condition checks for non-optimized paths, and
> eliminates the per-iteration check at the end of the loop, improving the
> performance.
The existing code is already well optimized, and even gcc figures out
that the min_depth_opt is only updated in the case as it is.
> Cc: Aviv Coro <aviv.coro at ibm.com>
> Cc: Bart Van Assche <bvanassche at acm.org>
> Cc: Benjamin Marzinski <bmarzins at redhat.com>
> Cc: Brian Bunker <brian at purestorage.com>
> Cc: Caleb Sander <csander at purestorage.com>
> Cc: Chaitanya Kulkarni <kch at nvidia.com>
> Cc: Chris Leech <cleech at redhat.com>
> Cc: Christophe Varoqui <christophe.varoqui at opensvc.com>
> Cc: Christoph Hellwig <hch at lst.de>
> Cc: Clayton Skaggs <claytons at netapp.com>
> Cc: Constantine Gavrilov <cgavrilov at infinidat.com>
> Cc: Daniel Wagner <wagi at kernel.org>
> Cc: David Santamaría Rogado <howl.nsp at gmail.com>
> Cc: Dmitry V. Levin <ldv at strace.io>
> Cc: Ewan D. Milne <emilne at redhat.com>
> Cc: Ewan Milne <emilne at redhat.com>
> Cc: Hannes Reinecke <hare at suse.de>
> Cc: James Smart <jsmart2021 at gmail.com>
> Cc: Jens Axboe <axboe at kernel.dk>
> Cc: John Meneghini <jmeneghi at redhat.com>
> Cc: Jyoti Rani <jrani at purestorage.com>
> Cc: Keith Busch <kbusch at kernel.org>
> Cc: Li Xiaokeng <lixiaokeng at huawei.com>
> Cc: Marco Patalano <mpatalan at redhat.com>
> Cc: Martin Belanger <martin.belanger at dell.com>
> Cc: Martin George <Martin.George at netapp.com>
> Cc: Martin Wilck <mwilck at suse.com>
> Cc: Matthias Rudolph <Matthias.Rudolph at hitachivantara.com>
> Cc: Maurizio Lombardi <mlombard at arkamax.eu>
> Cc: NetApp RDAC team <ng-eseries-upstream-maintainers at netapp.com>
> Cc: Nilay Shroff <nilay at linux.ibm.com>
> Cc: Randy Jennings <randyj at purestorage.com>
> Cc: Sagi Grimberg <sagi at grimberg.me>
> Cc: Simon Schricker <sschricker at suse.de>
> Cc: Steven Schremmer <Steve.Schremmer at netapp.com>
> Cc: Thomas Song <tsong at purestorage.com>
> Cc: Uday Shankar <ushankar at purestorage.com>
> Cc: Vasuki Manikarnike <vasuki.manikarnike at hpe.com>
> Cc: Wayne Berthiaume <Wayne.Berthiaume at dell.com>
> Cc: Zou Ming <zouming.zouming at huawei.com>
> Cc: BLOCK-ML <linux-block at vger.kernel.org>
> Cc: DM_DEVEL-ML <dm-devel at lists.linux.dev>
> Cc: NVME-ML <linux-nvme at lists.infradead.org>
> Cc: SCSI-ML <linux-scsi at vger.kernel.org>
This is quite an eggregious CC list...
> Status: Compile-tested only. UNTESTED on real hardware.
>
> [I do not have access to this kind of hardware]
What compelled you to propose this change, then?
More information about the Linux-nvme
mailing list