[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADUfDZqeDeJBVG9AFzSfP9CCAisaUsUa6o=D6NWxQEqorLQ6sQ@mail.gmail.com>
Date: Mon, 21 Apr 2025 09:43:26 -0700
From: Caleb Sander Mateos <csander@...estorage.com>
To: Keith Busch <kbusch@...nel.org>
Cc: Jens Axboe <axboe@...nel.dk>, Christoph Hellwig <hch@....de>, Sagi Grimberg <sagi@...mberg.me>,
Kanchan Joshi <joshi.k@...sung.com>, linux-nvme@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/2] nvme/pci: make PRP list DMA pools per-NUMA-node
On Mon, Apr 21, 2025 at 9:34 AM Keith Busch <kbusch@...nel.org> wrote:
>
> On Mon, Apr 21, 2025 at 10:17:25AM -0600, Caleb Sander Mateos wrote:
> > +static void nvme_release_prp_pools(struct nvme_dev *dev)
> > +{
> > + struct nvme_prp_dma_pools *pools_end = dev->prp_pools + nr_node_ids;
> > + struct nvme_prp_dma_pools *prp_pools;
> > +
> > + for (prp_pools = dev->prp_pools; prp_pools < pools_end; prp_pools++) {
> > + if (!prp_pools->small)
> > + continue;
> > +
> > + dma_pool_destroy(prp_pools->large);
> > + dma_pool_destroy(prp_pools->small);
> > + }
> > +}
>
> A minor difference in style, I think indexing looks cleaner than
> incrementing pointers:
Sure, can do that instead.
>
> static void nvme_release_prp_pools(struct nvme_dev *dev)
> {
> int i;
>
> for (i = 0; i < nr_node_ids; i++) {
> dma_pool_destroy(dev->prp_pools[i].small);
> dma_pool_destroy(dev->prp_pools[i].large);
> }
> }
>
> Note, dma_pool_destroy() already checks for NULL, so no need to check
> before calling it.
In that case, nvme_setup_prp_pools() would need to clear the large
dma_pool pointer in case of partial initialization (the large pool is
initialized successfully but the small pool fails). I can make that
switch if you'd prefer.
Best,
Caleb
Powered by blists - more mailing lists