From: John Garry <john.g.garry@oracle.com>
To: Caleb Sander Mateos <csander@purestorage.com>,
Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@kernel.dk>,
Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Kanchan Joshi <joshi.k@samsung.com>,
linux-nvme@lists.infradead.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 1/3] dmapool: add NUMA affinity support
Date: Mon, 28 Apr 2025 11:35:12 +0100 [thread overview]
Message-ID: <cb443e86-2639-4ed5-8d9c-00aa5e200f7e@oracle.com> (raw)
In-Reply-To: <20250426020636.34355-2-csander@purestorage.com>
On 26/04/2025 03:06, Caleb Sander Mateos wrote:
> From: Keith Busch <kbusch@kernel.org>
>
> Introduce dma_pool_create_node(), like dma_pool_create() but taking an
> additional NUMA node argument. Allocate struct dma_pool on the desired
> node, and store the node on dma_pool for allocating struct dma_page.
> Make dma_pool_create() an alias for dma_pool_create_node() with node set
> to NUMA_NO_NODE.
>
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
> Reviewed-by: Jens Axboe <axboe@kernel.dk>
> Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
FWIW,
Reviewed-by: John Garry <john.g.garry@oracle.com>
But a comment below.
>
> static struct dma_page *pool_alloc_page(struct dma_pool *pool, gfp_t mem_flags)
> {
> struct dma_page *page;
>
> - page = kmalloc(sizeof(*page), mem_flags);
> + page = kmalloc_node(sizeof(*page), mem_flags, pool->node);
> if (!page)
> return NULL;
For pool->node != NUMA_NO_NODE, pool->node == numa_node_id(), right? I
mean, aren't we on a CPU in pool->node here? And then - by default - we
try to allocate from the closest node to current CPU anyway (when not
specified), I think - that seems to have changed, when checking the
allocator code.
>
> page->vaddr = dma_alloc_coherent(pool->dev, pool->allocation,
> &page->dma, mem_flags);
next prev parent reply other threads:[~2025-04-28 10:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-26 2:06 [PATCH v6 0/3] nvme/pci: PRP list DMA pool partitioning Caleb Sander Mateos
2025-04-26 2:06 ` [PATCH v6 1/3] dmapool: add NUMA affinity support Caleb Sander Mateos
2025-04-28 10:35 ` John Garry [this message]
2025-04-28 15:01 ` Keith Busch
2025-05-05 10:36 ` Kanchan Joshi
2025-05-07 7:15 ` mm review needed, was: " Christoph Hellwig
2025-04-26 2:06 ` [PATCH v6 2/3] nvme/pci: factor out nvme_init_hctx() helper Caleb Sander Mateos
2025-05-07 7:16 ` Christoph Hellwig
2025-05-07 15:03 ` Caleb Sander Mateos
2025-04-26 2:06 ` [PATCH v6 3/3] nvme/pci: make PRP list DMA pools per-NUMA-node Caleb Sander Mateos
2025-05-02 16:48 ` [PATCH v6 0/3] nvme/pci: PRP list DMA pool partitioning Caleb Sander Mateos
2025-05-05 14:21 ` Keith Busch
2025-05-12 14:14 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cb443e86-2639-4ed5-8d9c-00aa5e200f7e@oracle.com \
--to=john.g.garry@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=csander@purestorage.com \
--cc=hch@lst.de \
--cc=joshi.k@samsung.com \
--cc=kbusch@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox