mm/cma: make MAX_CMA_AREAS = CONFIG_CMA_AREAS
authorAnshuman Khandual <anshuman.khandual@arm.com>
Mon, 5 Feb 2024 05:19:29 +0000 (10:49 +0530)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 22 Feb 2024 18:24:53 +0000 (10:24 -0800)
There is no real difference between the global area, and other
additionally configured CMA areas via CONFIG_CMA_AREAS that always
defaults without user input.  This makes MAX_CMA_AREAS same as
CONFIG_CMA_AREAS, also incrementing its default values, thus maintaining
current default for MAX_CMA_AREAS both for UMA and NUMA systems.

Link: https://lkml.kernel.org/r/20240205051929.298559-1-anshuman.khandual@arm.com
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/cma.h
mm/Kconfig

index 63873b93deaa62634da9ed3fb19543ba0131abdf..9db877506ea836846a8ae2fbb64a4a4c5ac8733d 100644 (file)
@@ -6,12 +6,8 @@
 #include <linux/types.h>
 #include <linux/numa.h>
 
-/*
- * There is always at least global CMA area and a few optional
- * areas configured in kernel .config.
- */
 #ifdef CONFIG_CMA_AREAS
-#define MAX_CMA_AREAS  (1 + CONFIG_CMA_AREAS)
+#define MAX_CMA_AREAS  CONFIG_CMA_AREAS
 #endif
 
 #define CMA_MAX_NAME 64
index 35fa9940e61fe4bc7e1fba2524a347f7d29051b5..88ba99d84ac3155c45d4ff3f692ba4ec3801e775 100644 (file)
@@ -917,14 +917,14 @@ config CMA_SYSFS
 config CMA_AREAS
        int "Maximum count of the CMA areas"
        depends on CMA
-       default 19 if NUMA
-       default 7
+       default 20 if NUMA
+       default 8
        help
          CMA allows to create CMA areas for particular purpose, mainly,
          used as device private area. This parameter sets the maximum
          number of CMA area in the system.
 
-         If unsure, leave the default value "7" in UMA and "19" in NUMA.
+         If unsure, leave the default value "8" in UMA and "20" in NUMA.
 
 config MEM_SOFT_DIRTY
        bool "Track memory changes"