powerpc/mm/book3s/radix: Add mapping statistics
[linux-2.6-block.git] / arch / powerpc / mm / pgtable-book3s64.c
index 78d0b3d5ebad1631b7349da988e8e0b3809485ad..01d7c0f7c4f0c2a12d15cd09bd66c88609dd235e 100644 (file)
@@ -455,3 +455,25 @@ void pgtable_free_tlb(struct mmu_gather *tlb, void *table, int index)
        return pgtable_free(table, index);
 }
 #endif
+
+#ifdef CONFIG_PROC_FS
+atomic_long_t direct_pages_count[MMU_PAGE_COUNT];
+
+void arch_report_meminfo(struct seq_file *m)
+{
+       /*
+        * Hash maps the memory with one size mmu_linear_psize.
+        * So don't bother to print these on hash
+        */
+       if (!radix_enabled())
+               return;
+       seq_printf(m, "DirectMap4k:    %8lu kB\n",
+                  atomic_long_read(&direct_pages_count[MMU_PAGE_4K]) << 2);
+       seq_printf(m, "DirectMap64k:    %8lu kB\n",
+                  atomic_long_read(&direct_pages_count[MMU_PAGE_64K]) << 6);
+       seq_printf(m, "DirectMap2M:    %8lu kB\n",
+                  atomic_long_read(&direct_pages_count[MMU_PAGE_2M]) << 11);
+       seq_printf(m, "DirectMap1G:    %8lu kB\n",
+                  atomic_long_read(&direct_pages_count[MMU_PAGE_1G]) << 20);
+}
+#endif /* CONFIG_PROC_FS */