[PATCH 4/7] hugetlb: add hugepage check in mem_cgroup_{register,end}_migration()
From: Naoya Horiguchi
Date: Fri Jul 02 2010 - 01:49:52 EST
Currently memory cgroup doesn't charge hugepage,
so avoid calling these functions in hugepage migration context.
Signed-off-by: Naoya Horiguchi <n-horiguchi@xxxxxxxxxxxxx>
Signed-off-by: Jun'ichi Nomura <j-nomura@xxxxxxxxxxxxx>
---
mm/memcontrol.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git v2.6.35-rc3-hwpoison/mm/memcontrol.c v2.6.35-rc3-hwpoison/mm/memcontrol.c
index c6ece0a..fed32de 100644
--- v2.6.35-rc3-hwpoison/mm/memcontrol.c
+++ v2.6.35-rc3-hwpoison/mm/memcontrol.c
@@ -2504,6 +2504,8 @@ int mem_cgroup_prepare_migration(struct page *page,
if (mem_cgroup_disabled())
return 0;
+ if (PageHuge(page))
+ return 0;
pc = lookup_page_cgroup(page);
lock_page_cgroup(pc);
@@ -2591,6 +2593,9 @@ void mem_cgroup_end_migration(struct mem_cgroup *mem,
if (!mem)
return;
+ if (PageHuge(oldpage))
+ return;
+
/* blocks rmdir() */
cgroup_exclude_rmdir(&mem->css);
/* at migration success, oldpage->mapping is NULL. */
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/