fs: proc: meminfo: add nvmap stats to meminfo
Krishna Reddy [Wed, 19 Jun 2013 18:50:24 +0000 (11:50 -0700)]
Change-Id: Ida9011d45abbd097dd09d2b42f67df17e05252a2
Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: http://git-master/r/240289
(cherry picked from commit a21680615f6ee5fe36f29601ecd3d16060258aaf)
Reviewed-on: http://git-master/r/247373
Reviewed-by: Bo Yan <byan@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User

fs/proc/meminfo.c

index 5aa847a..677ab67 100644 (file)
 #include <asm/pgtable.h>
 #include "internal.h"
 
+#if defined(CONFIG_TEGRA_NVMAP)
+#include <linux/nvmap.h>
+#endif
+
 void __attribute__((weak)) arch_report_meminfo(struct seq_file *m)
 {
 }
@@ -105,6 +109,10 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
                "AnonHugePages:  %8lu kB\n"
 #endif
+#if defined(CONFIG_TEGRA_NVMAP)
+               "NvMapMemFree:   %8lu kB\n"
+               "NvMapMemUsed:   %8lu kB\n"
+#endif
                ,
                K(i.totalram),
                K(i.freeram),
@@ -165,6 +173,10 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
                ,K(global_page_state(NR_ANON_TRANSPARENT_HUGEPAGES) *
                   HPAGE_PMD_NR)
 #endif
+#if defined(CONFIG_TEGRA_NVMAP)
+               , K(nvmap_page_pool_get_unused_pages()),
+               K(nvmap_iovmm_get_used_pages())
+#endif
                );
 
        hugetlb_report_meminfo(m);