[fedora-arm] [PATCH] Switch CMA to 10% RAM on armv7l and 128M on lpae/arm64

Nicolas Chauvet kwizart at gmail.com
Thu Aug 21 19:33:16 UTC 2014


This should offer an ever better conveniant default
than the default to 64M found in multi_v7_defconfig.
That, before a per-board solution to be found.
See rhbz#1127000

        RAM      CMA
armv7   128M??? ~13M
        256M    ~26M
        512M    ~51M
        1G     ~102M
        2G      205M
lpae    2G min? 128M
arm64   2G min? 128M

As already determined, CMA allocated memory can only be
set at boot time, whereas they can be used for others
purpose at runtime.

Quoting drivers/base/dma-contiguous.c:
----------------------
/*
 * Default global CMA area size can be defined in kernel's .config.
 * This is useful mainly for distro maintainers to create a kernel
 * that works correctly for most supported systems.
 * The size can be set in bytes or as a percentage of the total memory
 * in the system.
 *
 * Users, who want to set the size of global CMA area for their system
 * should use cma= kernel parameter.
 */
----------------------
---
 config-arm-generic |    4 ++--
 config-arm64       |    5 +++++
 config-armv7       |    5 +++++
 config-armv7-lpae  |    5 +++++
 4 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/config-arm-generic b/config-arm-generic
index ac89eb2..68e84e8 100644
--- a/config-arm-generic
+++ b/config-arm-generic
@@ -167,8 +167,8 @@ CONFIG_THERMAL_GOV_USER_SPACE=y
 CONFIG_CMA=y
 CONFIG_DMA_CMA=y
 # CONFIG_CMA_DEBUG is not set
-CONFIG_CMA_SIZE_MBYTES=16
-CONFIG_CMA_SIZE_SEL_MBYTES=y
+# CONFIG_CMA_SIZE_MBYTES is not set
+# CONFIG_CMA_SIZE_SEL_MBYTES is not set
 # CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set
 # CONFIG_CMA_SIZE_SEL_MIN is not set
 # CONFIG_CMA_SIZE_SEL_MAX is not set
diff --git a/config-arm64 b/config-arm64
index f6c244e..4c2a78d 100644
--- a/config-arm64
+++ b/config-arm64
@@ -42,6 +42,11 @@ CONFIG_HAVE_NET_DSA=y
 CONFIG_HVC_DRIVER=y
 CONFIG_HZ=100
 
+# Set arm64 kernel cma size
+# see rhbz#1127000
+CONFIG_CMA_SIZE_MBYTES=128
+CONFIG_CMA_SIZE_SEL_MBYTES=y
+
 CONFIG_KVM=y
 CONFIG_KVM_ARM_MAX_VCPUS=8
 CONFIG_LOG_BUF_SHIFT=14
diff --git a/config-armv7 b/config-armv7
index a2afb2b..7200ae7 100644
--- a/config-armv7
+++ b/config-armv7
@@ -21,6 +21,11 @@ CONFIG_ARCH_ZYNQ=y
 # CONFIG_ARM_VIRT_EXT is not set
 # CONFIG_VIRTUALIZATION is not set
 
+# Set non-lpae kernel cma size
+# see rhbz#1127000
+CONFIG_CMA_SIZE_PERCENTAGE=10
+CONFIG_CMA_SIZE_SEL_PERCENTAGE=y
+
 # mvebu
 CONFIG_MACH_ARMADA_370_XP=y
 CONFIG_MACH_ARMADA_370=y
diff --git a/config-armv7-lpae b/config-armv7-lpae
index 2536087..0dbf811 100644
--- a/config-armv7-lpae
+++ b/config-armv7-lpae
@@ -28,6 +28,11 @@ CONFIG_ARM_DMA_IOMMU_ALIGNMENT=8
 CONFIG_ARM_ERRATA_798181=y
 CONFIG_ARM_ERRATA_773022=y
 
+# Set lpae kernel cma size
+# see rhbz#1127000
+CONFIG_CMA_SIZE_MBYTES=128
+CONFIG_CMA_SIZE_SEL_MBYTES=y
+
 CONFIG_KVM=y
 CONFIG_KVM_ARM_HOST=y
 CONFIG_KVM_ARM_MAX_VCPUS=8
-- 
1.7.2.1



More information about the arm mailing list