aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-03-19 20:00:45 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-03-19 21:53:35 -0400
commit52ea27eb4cd5f250f33638029a134ff03c5e6bbb (patch)
tree56397e15561f77a3aed272c006c275e63f611091 /mm
parent0cf01f6685bef41dea37bbec606f375b7a98fd98 (diff)
memcgroup: fix check for thread being a group leader in memcgroup
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> Cc: Balbir Singh <balbir@linux.vnet.ibm.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Paul Menage <menage@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/memcontrol.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 8b9f6cae938e..9b648bd63451 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1079,7 +1079,7 @@ static void mem_cgroup_move_task(struct cgroup_subsys *ss,
1079 * Only thread group leaders are allowed to migrate, the mm_struct is 1079 * Only thread group leaders are allowed to migrate, the mm_struct is
1080 * in effect owned by the leader 1080 * in effect owned by the leader
1081 */ 1081 */
1082 if (p->tgid != p->pid) 1082 if (!thread_group_leader(p))
1083 goto out; 1083 goto out;
1084 1084
1085 css_get(&mem->css); 1085 css_get(&mem->css);