* [PATCH] Fix check for thread being a group leader in memcgroup
@ 2008-03-14 13:43 Pavel Emelyanov
0 siblings, 0 replies; only message in thread
From: Pavel Emelyanov @ 2008-03-14 13:43 UTC (permalink / raw)
To: Andrew Morton; +Cc: Balbir Singh, KAMEZAWA Hiroyuki, Linux Kernel Mailing List
The check t->pid == t->pid is not the blessed way to check
whether a task is a group leader.
This is not about the code beautifulness only, but about
pid namespaces fixes - both the tgid and the pid fields on
the task_struct are (slowly :( ) becoming deprecated.
Besides, the thread_group_leader() macro makes only one
dereference :)
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
---
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index eb681a6..bc4cac6 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1065,7 +1065,7 @@ static void mem_cgroup_move_task(struct cgroup_subsys *ss,
* Only thread group leaders are allowed to migrate, the mm_struct is
* in effect owned by the leader
*/
- if (p->tgid != p->pid)
+ if (!thread_group_leader(p))
goto out;
css_get(&mem->css);
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2008-03-14 13:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-14 13:43 [PATCH] Fix check for thread being a group leader in memcgroup Pavel Emelyanov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox