mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-16 13:19:56 -04:00
dmapool: add NUMA affinity support
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: John Garry <john.g.garry@oracle.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Kanchan Joshi <joshi.k@samsung.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
committed by
Christoph Hellwig
parent
0164d1350a
commit
1c9a93bf1d
@@ -11,6 +11,7 @@
|
||||
#ifndef LINUX_DMAPOOL_H
|
||||
#define LINUX_DMAPOOL_H
|
||||
|
||||
#include <linux/nodemask_types.h>
|
||||
#include <linux/scatterlist.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
@@ -18,8 +19,8 @@ struct device;
|
||||
|
||||
#ifdef CONFIG_HAS_DMA
|
||||
|
||||
struct dma_pool *dma_pool_create(const char *name, struct device *dev,
|
||||
size_t size, size_t align, size_t allocation);
|
||||
struct dma_pool *dma_pool_create_node(const char *name, struct device *dev,
|
||||
size_t size, size_t align, size_t boundary, int node);
|
||||
|
||||
void dma_pool_destroy(struct dma_pool *pool);
|
||||
|
||||
@@ -35,9 +36,12 @@ struct dma_pool *dmam_pool_create(const char *name, struct device *dev,
|
||||
void dmam_pool_destroy(struct dma_pool *pool);
|
||||
|
||||
#else /* !CONFIG_HAS_DMA */
|
||||
static inline struct dma_pool *dma_pool_create(const char *name,
|
||||
struct device *dev, size_t size, size_t align, size_t allocation)
|
||||
{ return NULL; }
|
||||
static inline struct dma_pool *dma_pool_create_node(const char *name,
|
||||
struct device *dev, size_t size, size_t align, size_t boundary,
|
||||
int node)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
static inline void dma_pool_destroy(struct dma_pool *pool) { }
|
||||
static inline void *dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags,
|
||||
dma_addr_t *handle) { return NULL; }
|
||||
@@ -49,6 +53,13 @@ static inline struct dma_pool *dmam_pool_create(const char *name,
|
||||
static inline void dmam_pool_destroy(struct dma_pool *pool) { }
|
||||
#endif /* !CONFIG_HAS_DMA */
|
||||
|
||||
static inline struct dma_pool *dma_pool_create(const char *name,
|
||||
struct device *dev, size_t size, size_t align, size_t boundary)
|
||||
{
|
||||
return dma_pool_create_node(name, dev, size, align, boundary,
|
||||
NUMA_NO_NODE);
|
||||
}
|
||||
|
||||
static inline void *dma_pool_zalloc(struct dma_pool *pool, gfp_t mem_flags,
|
||||
dma_addr_t *handle)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user