aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memcontrol.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r--mm/memcontrol.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index bd9052a5d3a..e37c44d88d4 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -735,7 +735,7 @@ struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p)
735 struct mem_cgroup, css); 735 struct mem_cgroup, css);
736} 736}
737 737
738static struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm) 738struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm)
739{ 739{
740 struct mem_cgroup *mem = NULL; 740 struct mem_cgroup *mem = NULL;
741 741
@@ -5414,18 +5414,16 @@ static void mem_cgroup_move_task(struct cgroup_subsys *ss,
5414 struct cgroup *old_cont, 5414 struct cgroup *old_cont,
5415 struct task_struct *p) 5415 struct task_struct *p)
5416{ 5416{
5417 struct mm_struct *mm; 5417 struct mm_struct *mm = get_task_mm(p);
5418 5418
5419 if (!mc.to)
5420 /* no need to move charge */
5421 return;
5422
5423 mm = get_task_mm(p);
5424 if (mm) { 5419 if (mm) {
5425 mem_cgroup_move_charge(mm); 5420 if (mc.to)
5421 mem_cgroup_move_charge(mm);
5422 put_swap_token(mm);
5426 mmput(mm); 5423 mmput(mm);
5427 } 5424 }
5428 mem_cgroup_clear_mc(); 5425 if (mc.to)
5426 mem_cgroup_clear_mc();
5429} 5427}
5430#else /* !CONFIG_MMU */ 5428#else /* !CONFIG_MMU */
5431static int mem_cgroup_can_attach(struct cgroup_subsys *ss, 5429static int mem_cgroup_can_attach(struct cgroup_subsys *ss,