From: Zi Yan <ziy@xxxxxxxxxx> Ask the page what size it is instead of assuming PMD size. Signed-off-by: Zi Yan <ziy@xxxxxxxxxx> Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx> --- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 3a24e3b619f5..e7824c4dab25 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -3280,7 +3280,7 @@ void mem_cgroup_split_huge_fixup(struct page *head) if (mem_cgroup_disabled()) return; - for (i = 1; i < HPAGE_PMD_NR; i++) { + for (i = 1; i < thp_nr_pages(head); i++) { css_get(&memcg->css); head[i].mem_cgroup = memcg; } -- 2.28.0