Skip to contentSkip to conversation

mm/hugetlb: fix incorrect hugepages count during mem hotplug

PATCH New [email protected] 1 participant 1 message Aug 11, 2016

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/7 mm/hugetlb: fix incorrect hugepages count during mem hotplug

From: zhong jiang <[email protected]>
Subject: mm/hugetlb: fix incorrect hugepages count during mem hotplug

When memory hotplug operates, free hugepages will be freed if the movable node is offline. Therefore, /proc/sys/vm/nr_hugepages will be incorrect.

Fix it by reducing max_huge_pages when the node is offlined.

[email protected] said:

: dissolve_free_huge_page intends to break a hugepage into buddy, and the : destination hugepage is supposed to be allocated from the pool of the : destination node, so the system-wide pool size is reduced. So adding : h->max_huge_pages-- makes sense to me.

---

 mm/hugetlb.c |    1 +
 1 file changed, 1 insertion(+)
mm/hugetlb.c renamed from mm/hugetlb.c~mm-fix-the-incorrect-hugepages-count +1 -0
diff -puN mm/hugetlb.c~mm-fix-the-incorrect-hugepages-count mm/hugetlb.c
@@ -1448,6 +1448,7 @@ static void dissolve_free_huge_page(stru
 		list_del(&page->lru);
 		h->free_huge_pages--;
 		h->free_huge_pages_node[nid]--;
+		h->max_huge_pages--;
 		update_and_free_page(h, page);
 	}
 	spin_unlock(&hugetlb_lock);

_