meminfo, thp: modify ifdef coverage to remove unexpected variable printing
authorSung-hun Kim <sfoon.kim@samsung.com>
Thu, 30 Sep 2021 00:37:45 +0000 (09:37 +0900)
committerHoegeun Kwon <hoegeun.kwon@samsung.com>
Mon, 7 Feb 2022 08:01:41 +0000 (17:01 +0900)
If the system uses fTHP, the user can show statistics of
hugepage-mapped CMA pages via /proc/meminfo.
Otherwise, the user does not need to aware of such variables.
This patch removes such exported variables when fTHP-disabled
kernel is used.

Change-Id: Iaff9dd8d81da1a3caa60959b9c5c1f44544f30d4
Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
fs/proc/meminfo.c

index e619d5b..7cc0633 100644 (file)
@@ -157,9 +157,9 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
                    global_node_page_state(NR_FILE_PTEMAPPED) * HPAGE_CONT_PTE_NR);
        show_val_kb(m, "PhysCPteMapped: ",
                    phys_cont_pte_pages());
-#endif /* CONFIG_FINEGRAINED_THP */
        show_val_kb(m, "PhysPmdMapped:  ",
                    phys_huge_pmd_pages());
+#endif /* CONFIG_FINEGRAINED_THP */
 #endif
 #ifdef CONFIG_CMA
        show_val_kb(m, "CmaTotal:       ", totalcma_pages);