diff options
author | Yajun Deng <yajun.deng@linux.dev> | 2023-05-12 17:42:10 +0800 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2023-07-31 17:54:28 +0200 |
commit | 22e4a348f87c59df2c02f1efb7ba9a56b622c7b8 (patch) | |
tree | 30ce9c2e09b1991ecff13f8554f908636fc647b9 /kernel/dma/contiguous.c | |
parent | 3d6f126b15d9fd8435455fffc912d976973a7a09 (diff) |
dma-contiguous: support per-numa CMA for all architectures
In the commit b7176c261cdb ("dma-contiguous: provide the ability to
reserve per-numa CMA"), Barry adds DMA_PERNUMA_CMA for ARM64.
But this feature is architecture independent, so support per-numa CMA
for all architectures, and enable it by default if NUMA.
Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
Tested-by: Yicong Yang <yangyicong@hisilicon.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'kernel/dma/contiguous.c')
-rw-r--r-- | kernel/dma/contiguous.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/kernel/dma/contiguous.c b/kernel/dma/contiguous.c index 6ea80ae42622..26a8e5365fcd 100644 --- a/kernel/dma/contiguous.c +++ b/kernel/dma/contiguous.c @@ -128,7 +128,7 @@ static inline __maybe_unused phys_addr_t cma_early_percent_memory(void) #endif #ifdef CONFIG_DMA_PERNUMA_CMA -void __init dma_pernuma_cma_reserve(void) +static void __init dma_pernuma_cma_reserve(void) { int nid; @@ -153,6 +153,10 @@ void __init dma_pernuma_cma_reserve(void) (unsigned long long)pernuma_size_bytes / SZ_1M, nid); } } +#else +static inline void __init dma_pernuma_cma_reserve(void) +{ +} #endif /** @@ -171,6 +175,8 @@ void __init dma_contiguous_reserve(phys_addr_t limit) phys_addr_t selected_limit = limit; bool fixed = false; + dma_pernuma_cma_reserve(); + pr_debug("%s(limit %08lx)\n", __func__, (unsigned long)limit); if (size_cmdline != -1) { |