浏览代码

hugetlb: indicate surplus huge page counts in per-node meminfo

Currently we show the surplus hugetlb pool state in /proc/meminfo, but
not in the per-node meminfo files, even though we track the information
on a per-node basis. Printing it there can help track down dynamic pool
bugs including the one in the follow-on patch.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Nishanth Aravamudan 17 年之前
父节点
当前提交
a1de09195b
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      mm/hugetlb.c

+ 4 - 2
mm/hugetlb.c

@@ -671,9 +671,11 @@ int hugetlb_report_node_meminfo(int nid, char *buf)
 {
 {
 	return sprintf(buf,
 	return sprintf(buf,
 		"Node %d HugePages_Total: %5u\n"
 		"Node %d HugePages_Total: %5u\n"
-		"Node %d HugePages_Free:  %5u\n",
+		"Node %d HugePages_Free:  %5u\n"
+		"Node %d HugePages_Surp:  %5u\n",
 		nid, nr_huge_pages_node[nid],
 		nid, nr_huge_pages_node[nid],
-		nid, free_huge_pages_node[nid]);
+		nid, free_huge_pages_node[nid],
+		nid, surplus_huge_pages_node[nid]);
 }
 }
 
 
 /* Return the number pages of memory we physically have, in PAGE_SIZE units. */
 /* Return the number pages of memory we physically have, in PAGE_SIZE units. */