aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memcontrol.c
diff options
context:
space:
mode:
authorAndrea Arcangeli <aarcange@redhat.com>2011-01-13 18:47:16 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 20:32:47 -0500
commit37c2ac7872a9387542616f658d20ac25f5bdb32e (patch)
treed115915db4a61e261012bf0f9c4cf14630243d71 /mm/memcontrol.c
parent91600e9e592e48736e630851c83da2ad6bf0e91f (diff)
thp: compound_trans_order
Read compound_trans_order safe. Noop for CONFIG_TRANSPARENT_HUGEPAGE=n. Signed-off-by: Andrea Arcangeli <aarcange@redhat.com> Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r--mm/memcontrol.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index f4ea3410fb4d..741206ffdace 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1027,10 +1027,6 @@ mem_cgroup_get_reclaim_stat_from_page(struct page *page)
1027{ 1027{
1028 struct page_cgroup *pc; 1028 struct page_cgroup *pc;
1029 struct mem_cgroup_per_zone *mz; 1029 struct mem_cgroup_per_zone *mz;
1030 int page_size = PAGE_SIZE;
1031
1032 if (PageTransHuge(page))
1033 page_size <<= compound_order(page);
1034 1030
1035 if (mem_cgroup_disabled()) 1031 if (mem_cgroup_disabled())
1036 return NULL; 1032 return NULL;
@@ -2286,8 +2282,10 @@ static int mem_cgroup_charge_common(struct page *page, struct mm_struct *mm,
2286 int ret; 2282 int ret;
2287 int page_size = PAGE_SIZE; 2283 int page_size = PAGE_SIZE;
2288 2284
2289 if (PageTransHuge(page)) 2285 if (PageTransHuge(page)) {
2290 page_size <<= compound_order(page); 2286 page_size <<= compound_order(page);
2287 VM_BUG_ON(!PageTransHuge(page));
2288 }
2291 2289
2292 pc = lookup_page_cgroup(page); 2290 pc = lookup_page_cgroup(page);
2293 /* can happen at boot */ 2291 /* can happen at boot */
@@ -2558,8 +2556,10 @@ __mem_cgroup_uncharge_common(struct page *page, enum charge_type ctype)
2558 if (PageSwapCache(page)) 2556 if (PageSwapCache(page))
2559 return NULL; 2557 return NULL;
2560 2558
2561 if (PageTransHuge(page)) 2559 if (PageTransHuge(page)) {
2562 page_size <<= compound_order(page); 2560 page_size <<= compound_order(page);
2561 VM_BUG_ON(!PageTransHuge(page));
2562 }
2563 2563
2564 count = page_size >> PAGE_SHIFT; 2564 count = page_size >> PAGE_SHIFT;
2565 /* 2565 /*