aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/memcontrol.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 9b648bd63451..23b5fa4cabd8 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -533,6 +533,9 @@ static int mem_cgroup_charge_common(struct page *page, struct mm_struct *mm,
533 unsigned long nr_retries = MEM_CGROUP_RECLAIM_RETRIES; 533 unsigned long nr_retries = MEM_CGROUP_RECLAIM_RETRIES;
534 struct mem_cgroup_per_zone *mz; 534 struct mem_cgroup_per_zone *mz;
535 535
536 if (mem_cgroup_subsys.disabled)
537 return 0;
538
536 /* 539 /*
537 * Should page_cgroup's go to their own slab? 540 * Should page_cgroup's go to their own slab?
538 * One could optimize the performance of the charging routine 541 * One could optimize the performance of the charging routine
@@ -665,6 +668,9 @@ void mem_cgroup_uncharge_page(struct page *page)
665 struct mem_cgroup_per_zone *mz; 668 struct mem_cgroup_per_zone *mz;
666 unsigned long flags; 669 unsigned long flags;
667 670
671 if (mem_cgroup_subsys.disabled)
672 return;
673
668 /* 674 /*
669 * Check if our page_cgroup is valid 675 * Check if our page_cgroup is valid
670 */ 676 */
@@ -705,6 +711,9 @@ int mem_cgroup_prepare_migration(struct page *page)
705{ 711{
706 struct page_cgroup *pc; 712 struct page_cgroup *pc;
707 713
714 if (mem_cgroup_subsys.disabled)
715 return 0;
716
708 lock_page_cgroup(page); 717 lock_page_cgroup(page);
709 pc = page_get_page_cgroup(page); 718 pc = page_get_page_cgroup(page);
710 if (pc) 719 if (pc)
@@ -803,6 +812,9 @@ static int mem_cgroup_force_empty(struct mem_cgroup *mem)
803 int ret = -EBUSY; 812 int ret = -EBUSY;
804 int node, zid; 813 int node, zid;
805 814
815 if (mem_cgroup_subsys.disabled)
816 return 0;
817
806 css_get(&mem->css); 818 css_get(&mem->css);
807 /* 819 /*
808 * page reclaim code (kswapd etc..) will move pages between 820 * page reclaim code (kswapd etc..) will move pages between
@@ -1053,6 +1065,8 @@ static void mem_cgroup_destroy(struct cgroup_subsys *ss,
1053static int mem_cgroup_populate(struct cgroup_subsys *ss, 1065static int mem_cgroup_populate(struct cgroup_subsys *ss,
1054 struct cgroup *cont) 1066 struct cgroup *cont)
1055{ 1067{
1068 if (mem_cgroup_subsys.disabled)
1069 return 0;
1056 return cgroup_add_files(cont, ss, mem_cgroup_files, 1070 return cgroup_add_files(cont, ss, mem_cgroup_files,
1057 ARRAY_SIZE(mem_cgroup_files)); 1071 ARRAY_SIZE(mem_cgroup_files));
1058} 1072}
@@ -1065,6 +1079,9 @@ static void mem_cgroup_move_task(struct cgroup_subsys *ss,
1065 struct mm_struct *mm; 1079 struct mm_struct *mm;
1066 struct mem_cgroup *mem, *old_mem; 1080 struct mem_cgroup *mem, *old_mem;
1067 1081
1082 if (mem_cgroup_subsys.disabled)
1083 return;
1084
1068 mm = get_task_mm(p); 1085 mm = get_task_mm(p);
1069 if (mm == NULL) 1086 if (mm == NULL)
1070 return; 1087 return;