diff mbox

[v2,2/7] hugetlb: support migrate charging for surplus hugepages

Message ID 48877585-85de-ad4b-6b35-8e6dd24a43c0@ascade.co.jp (mailing list archive)
State New, archived
Headers show

Commit Message

TSUKADA Koutaro May 18, 2018, 4:32 a.m. UTC
Surplus hugepages allocated for migration also charge to memory cgroup.

Signed-off-by: TSUKADA Koutaro <tsukada@ascade.co.jp>
---
 hugetlb.c |    2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 679c151f..2e7b543 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1687,6 +1687,8 @@  static struct page *alloc_migrate_huge_page(struct hstate *h, gfp_t gfp_mask,
 	if (!page)
 		return NULL;

+	surplus_hugepage_set_charge(h, page);
+
 	/*
 	 * We do not account these pages as surplus because they are only
 	 * temporary and will be released properly on the last reference