• Pintu Kumar's avatar
    mm: cma: split cma-reserved in dmesg log · e48322ab
    Pintu Kumar authored
    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: default avatarPintu Kumar <pintu.k@samsung.com>
    Signed-off-by: default avatarVishnu Pratap Singh <vishnu.ps@samsung.com>
    Acked-by: default avatarMichal 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: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    e48322ab
cma.c 11.9 KB