From e48322abb061d75096fe52d71886b237e7ae7bfb Mon Sep 17 00:00:00 2001 From: Pintu Kumar Date: Thu, 18 Dec 2014 16:17:15 -0800 Subject: mm: cma: split cma-reserved in dmesg log When the system boots up, in the dmesg logs we can see the memory statistics along with total reserved as below. Memory: 458840k/458840k available, 65448k reserved, 0K highmem When CMA is enabled, still the total reserved memory remains the same. However, the CMA memory is not considered as reserved. But, when we see /proc/meminfo, the CMA memory is part of free memory. This creates confusion. This patch corrects the problem by properly subtracting the CMA reserved memory from the total reserved memory in dmesg logs. Below is the dmesg snapshot from an arm based device with 512MB RAM and 12MB single CMA region. Before this change: Memory: 458840k/458840k available, 65448k reserved, 0K highmem After this change: Memory: 458840k/458840k available, 53160k reserved, 12288k cma-reserved, 0K highmem Signed-off-by: Pintu Kumar Signed-off-by: Vishnu Pratap Singh Acked-by: Michal Nazarewicz Cc: Rafael Aquini Cc: Jerome Marchand Cc: Marek Szyprowski Cc: Joonsoo Kim Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/cma.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/cma.h b/include/linux/cma.h index a93438beb33..9384ba66e97 100644 --- a/include/linux/cma.h +++ b/include/linux/cma.h @@ -15,6 +15,7 @@ struct cma; +extern unsigned long totalcma_pages; extern phys_addr_t cma_get_base(struct cma *cma); extern unsigned long cma_get_size(struct cma *cma); -- cgit v1.2.3-70-g09d2