linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: fix the incorrect hugepages count
@ 2016-08-08  2:49 zhongjiang
  2016-08-08 17:14 ` Mike Kravetz
  0 siblings, 1 reply; 4+ messages in thread
From: zhongjiang @ 2016-08-08  2:49 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel

From: zhong jiang <zhongjiang@huawei.com>

when memory hotplug enable, free hugepages will be freed if movable node offline.
therefore, /proc/sys/vm/nr_hugepages will be incorrect.

The patch fix it by reduce the max_huge_pages when the node offline.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 mm/hugetlb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index f904246..3356e3a 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1448,6 +1448,7 @@ static void dissolve_free_huge_page(struct page *page)
 		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);
-- 
1.8.3.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-08-10  0:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-08  2:49 [PATCH] mm: fix the incorrect hugepages count zhongjiang
2016-08-08 17:14 ` Mike Kravetz
2016-08-09 10:32   ` zhong jiang
2016-08-10  0:07     ` Naoya Horiguchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox