[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230512140859.641222bd40cfa4b1ee591cc6@linux-foundation.org>
Date: Fri, 12 May 2023 14:08:59 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Yajun Deng <yajun.deng@...ux.dev>
Cc: corbet@....net, catalin.marinas@....com, will@...nel.org,
hch@....de, m.szyprowski@...sung.com, robin.murphy@....com,
paulmck@...nel.org, bp@...e.de, peterz@...radead.org,
rdunlap@...radead.org, kim.phillips@....com, rostedt@...dmis.org,
thunder.leizhen@...wei.com, ardb@...nel.org, bhe@...hat.com,
anshuman.khandual@....com, song.bao.hua@...ilicon.com,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, iommu@...ts.linux.dev
Subject: Re: [PATCH] dma-contiguous: support per-numa CMA for all
architectures
On Fri, 12 May 2023 17:42:10 +0800 Yajun Deng <yajun.deng@...ux.dev> wrote:
> 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.
>
> ...
>
> --- a/include/linux/dma-map-ops.h
> +++ b/include/linux/dma-map-ops.h
> @@ -168,12 +168,6 @@ static inline void dma_free_contiguous(struct device *dev, struct page *page,
> }
> #endif /* CONFIG_DMA_CMA*/
>
> -#ifdef CONFIG_DMA_PERNUMA_CMA
> -void dma_pernuma_cma_reserve(void);
> -#else
> -static inline void dma_pernuma_cma_reserve(void) { }
It would be a little nicer to retain this line.
> -#endif /* CONFIG_DMA_PERNUMA_CMA */
> -
> #ifdef CONFIG_DMA_DECLARE_COHERENT
> int dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr,
> dma_addr_t device_addr, size_t size);
>
> ...
>
> --- 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
And to not add this function?
Powered by blists - more mailing lists