From 89a41e435db261091356dbbfcd6268614aa8763b Mon Sep 17 00:00:00 2001 From: Sung-hun Kim Date: Thu, 30 Sep 2021 09:37:45 +0900 Subject: [PATCH] meminfo, thp: modify ifdef coverage to remove unexpected variable printing 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 --- fs/proc/meminfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c index e619d5b..7cc0633 100644 --- a/fs/proc/meminfo.c +++ b/fs/proc/meminfo.c @@ -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); -- 2.7.4