summaryrefslogtreecommitdiff
path: root/mm/cma.c
diff options
context:
space:
mode:
authorPintu Kumar <pintu.k@samsung.com>2014-12-18 16:17:15 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-18 19:08:10 -0800
commite48322abb061d75096fe52d71886b237e7ae7bfb (patch)
treef0fea5784bdc1e0e4afbda32cecdb03d179c3adb /mm/cma.c
parent89ac9b4d3d1a049ae1054f99b1aed81092cd0a82 (diff)
downloadlinux-rpi3-e48322abb061d75096fe52d71886b237e7ae7bfb.tar.gz
linux-rpi3-e48322abb061d75096fe52d71886b237e7ae7bfb.tar.bz2
linux-rpi3-e48322abb061d75096fe52d71886b237e7ae7bfb.zip
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 <pintu.k@samsung.com> Signed-off-by: Vishnu Pratap Singh <vishnu.ps@samsung.com> Acked-by: Michal Nazarewicz <mina86@mina86.com> Cc: Rafael Aquini <aquini@redhat.com> Cc: Jerome Marchand <jmarchan@redhat.com> Cc: Marek Szyprowski <m.szyprowski@samsung.com> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/cma.c')
-rw-r--r--mm/cma.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/mm/cma.c b/mm/cma.c
index f8917629cbdd..a85ae28709a3 100644
--- a/mm/cma.c
+++ b/mm/cma.c
@@ -337,6 +337,7 @@ int __init cma_declare_contiguous(phys_addr_t base,
if (ret)
goto err;
+ totalcma_pages += (size / PAGE_SIZE);
pr_info("Reserved %ld MiB at %pa\n", (unsigned long)size / SZ_1M,
&base);
return 0;