[Devel] Re: [PATCH] Unused check for thread group leader in mem_cgroup_move_task

Nikanth Karthikesan knikanth at suse.de
Sun Nov 30 20:21:35 PST 2008


On Monday 01 December 2008 06:42:08 KAMEZAWA Hiroyuki wrote:
> On Sat, 29 Nov 2008 12:59:27 +0530
>
> Nikanth Karthikesan <knikanth at suse.de> wrote:
> > Currently we just check for thread group leader in attach() handler but
> > do nothing!  Either (1) move it to can_attach handler or (2) remove the
> > test itself. I am attaching patches for both below.
> >
> > Thanks
> > Nikanth Karthikesan
> >
> > Move thread group leader check to can_attach handler, but this may
> > prevent non thread group leaders to be moved at all!
> >
> > Signed-off-by: Nikanth Karthikesan <knikanth at suse.de>
>
> It's allowed.
>
> Nack.
>

Ok. Then should we remove the unused code which simply checks for thread group 
leader but does nothing?
 
Thanks
Nikanth

Remove the unused test for thread group leader in mem_cgroup_move_task.

Signed-off-by: Nikanth Karthikesan <knikanth at suse.de>

---

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 866dcc7..8e9287d 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1151,14 +1151,6 @@ static void mem_cgroup_move_task(struct cgroup_subsys 
*ss,
 	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
-	 */
-	if (!thread_group_leader(p))
-		goto out;
-
-out:
 	mmput(mm);
 }
 

_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list