dma-contiguous: fix the Kconfig entry for CONFIG_DMA_NUMA_CMA
PATCH 1/1 dma-contiguous: fix the Kconfig entry for CONFIG_DMA_NUMA_CMA
It makes no sense to expose CONFIG_DMA_NUMA_CMA if CONFIG_NUMA is not enabled, and random config options shouldn't be default unless there is a good reason. Replace the default NUMA with a depends on to fix both issues.
--- kernel/dma/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/dma/Kconfig +1 -1
@@ -160,7 +160,7 @@ if DMA_CMA config DMA_NUMA_CMA bool "Enable separate DMA Contiguous Memory Area for NUMA Node" - default NUMA + depends on NUMA help Enable this option to get numa CMA areas so that NUMA devices can get local memory by DMA coherent APIs.
Signature · 1 line
2.39.2
Quoted 4 lines · Christoph Hellwig
It makes no sense to expose
CONFIG_DMA_NUMA_CMAifCONFIG_NUMAis not enabled, and random config options shouldn't be default unless there is a good reason. Replace the default NUMA with a depends on to fix both issues.
I think the "good reason" is that folks who do have NUMA systems are likely to be more interested in getting more consistent DMA performance than losing a bit more non-movable memory capacity, and the runtime impact on non-NUMA systems should be negligible, so I would definitely be inclined to make it "default y". But it's not critically important.
For the fundamental dependency change which absolutely makes sense,
Quoted 18 lines
Signed-off-by Christoph Hellwig <[email protected]>--- kernel/dma/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/dma/Kconfig +1
-1@@ -160,7 +160,7 @@ if DMA_CMA config DMA_NUMA_CMA bool "Enable separate DMA Contiguous Memory Area for NUMA Node" - default NUMA + depends on NUMA help Enable this option to get numa CMA areas so that NUMA devices can get local memory by DMA coherent APIs.
Quoted 5 lines · Robin Murphy
I think the "good reason" is that folks who do have NUMA systems are likely to be more interested in getting more consistent DMA performance than losing a bit more non-movable memory capacity, and the runtime impact on non-NUMA systems should be negligible, so I would definitely be inclined to make it "default y". But it's not critically important.
Well, Linus hates these default y, and usually for a good reason. If it's that useful/importanst for numa systems we should just drop the option and make the code conditional on CONFIG_NUMA only.
Robin Murphy
reviewerQuoted 10 lines · Christoph Hellwig
Quoted 5 lines · Robin Murphy
I think the "good reason" is that folks who do have NUMA systems are likely to be more interested in getting more consistent DMA performance than losing a bit more non-movable memory capacity, and the runtime impact on non-NUMA systems should be negligible, so I would definitely be inclined to make it "default y". But it's not critically important.
Well, Linus hates these default y, and usually for a good reason. If it's that useful/importanst for numa systems we should just drop the option and make the code conditional on
CONFIG_NUMAonly.
Hmm, good point. In fact, after double-checking, the amount of code saved by disabling it looks pretty trivial, and it does need an explicit command-line option to activate the "special" behaviour anyway, so indeed I'm now starting to doubt whether the separate config option is worthwhile at all.
Cheers,
Robin.