Skip to content

Commit

Permalink
memcg: check group leader fix
Browse files Browse the repository at this point in the history
Remove unnecessary codes (...fragments of not-implemented
functionalilty...)

Reported-by: Nikanth Karthikesan <knikanth@suse.de>
Signed-off-by: Nikanth Karthikesan <knikanth@suse.de>
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Balbir Singh <balbir@in.ibm.com>
Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Nikanth Karthikesan authored and Linus Torvalds committed Jan 8, 2009
1 parent 2c26fdd commit f9717d2
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -2008,25 +2008,10 @@ static void mem_cgroup_move_task(struct cgroup_subsys *ss,
struct cgroup *old_cont,
struct task_struct *p)
{
struct mm_struct *mm;
struct mem_cgroup *mem, *old_mem;

mm = get_task_mm(p);
if (mm == NULL)
return;

mem = mem_cgroup_from_cont(cont);
old_mem = mem_cgroup_from_cont(old_cont);

/*
* Only thread group leaders are allowed to migrate, the mm_struct is
* in effect owned by the leader
* FIXME: It's better to move charges of this process from old
* memcg to new memcg. But it's just on TODO-List now.
*/
if (!thread_group_leader(p))
goto out;

out:
mmput(mm);
}

struct cgroup_subsys mem_cgroup_subsys = {
Expand Down

0 comments on commit f9717d2

Please sign in to comment.