[PATCH v3 3/4] nvme: move ns id info to struct nvme_ns_head

Christoph Hellwig hch at lst.de
Wed Dec 6 00:54:36 PST 2023


On Wed, Dec 06, 2023 at 09:12:43AM +0100, Daniel Wagner wrote:
> Move the namesapce info to struct nvme_ns_head, because it's the same
> for all associated namespaces.
> 
> The head pointer is accessible from the ns pointer so we could just
> update all places with ns->x to ns->head->x. While this is okay for the
> slow path,

Do you have any data to show that it matters?  All the I/O command
setup functions already access the ns_head for ->ns_id, so looking
at more fields can't really make any difference.

If we have a good argument about reducing the pointer chasing I'm all
for it, but please as a separate, well-documented commit that also
explains the tradeoffs for the newly added lookups this adds in a few
places.



More information about the Linux-nvme mailing list