Re: [PATCH v6 1/3] dmapool: add NUMA affinity support

Keith Busch
2025-04-28T15:01:40Z

On Mon, Apr 28, 2025 at 11:35:12AM +0100, John Garry wrote:
> > 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?

Not necessarily. blk-mq hctx's could span numa nodes. We just want to
register the dma pool with whichever one is the first node.