[PATCH 8/9] mm: Fix THP size assumption in mem_cgroup_split_huge_fixup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux