From 0eb07522e04bf26df2580bec642f07b1b28fcb7b Mon Sep 17 00:00:00 2001 From: Minchan Kim Date: Tue, 23 Mar 2021 18:11:13 -0700 Subject: [PATCH] ANDROID: GKI: enable CONFIG_CMA_SYSFS Since CMA is getting used more widely, it's more important to keep monitoring CMA statistics for system health since it's directly related to user experience. This feature introduces sysfs statistics for CMA, in order to provide some basic monitoring of the CMA allocator. * the number of CMA page successful allocations * the number of CMA page allocation failures These two values allow the user to calculate the allocation failure rate for each CMA area. Additionally, this feature also exposes the number of successful CMA pages that have been freed. This can be used with the number of CMA pages that have been successfully allocated to deduce how many CMA pages are allocated at a particular moment in time. This is useful, as it provides some insight into how memory is allocated, therefore allowing Android to improve its lost RAM calculation. Bug: 179256052 Bug: 371518137 Bug: 228238851 Signed-off-by: Minchan Kim Change-Id: I5c8dc58a5d195d2e1b2e25628545f7d2a9c3b7df Signed-off-by: Richard Chang [isaacmanjarres: added additional bug tags and expanded commit message.] Signed-off-by: Isaac J. Manjarres --- arch/arm64/configs/gki_defconfig | 1 + arch/x86/configs/gki_defconfig | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/arm64/configs/gki_defconfig b/arch/arm64/configs/gki_defconfig index 836eb0544bb2..bcf869873ddc 100644 --- a/arch/arm64/configs/gki_defconfig +++ b/arch/arm64/configs/gki_defconfig @@ -123,6 +123,7 @@ CONFIG_TRANSPARENT_HUGEPAGE=y CONFIG_TRANSPARENT_HUGEPAGE_MADVISE=y CONFIG_CMA=y CONFIG_CMA_DEBUGFS=y +CONFIG_CMA_SYSFS=y CONFIG_CMA_AREAS=16 # CONFIG_ZONE_DMA is not set CONFIG_ANON_VMA_NAME=y diff --git a/arch/x86/configs/gki_defconfig b/arch/x86/configs/gki_defconfig index 93deb1fec989..7e2f4657d7df 100644 --- a/arch/x86/configs/gki_defconfig +++ b/arch/x86/configs/gki_defconfig @@ -116,6 +116,7 @@ CONFIG_TRANSPARENT_HUGEPAGE=y CONFIG_TRANSPARENT_HUGEPAGE_MADVISE=y CONFIG_CMA=y CONFIG_CMA_DEBUGFS=y +CONFIG_CMA_SYSFS=y CONFIG_CMA_AREAS=16 # CONFIG_ZONE_DMA is not set CONFIG_ANON_VMA_NAME=y