All of lore.kernel.org
 help / color / mirror / Atom feed
* + cgroups-fix-ordering-of-calls-in-cgroup_attach_proc.patch added to -mm tree
@ 2011-08-25 20:44 akpm
  2011-08-26 15:12 ` Oleg Nesterov
  2011-08-26 15:38 ` [PATCH v2] cgroups: Don't attach task to subsystem if migration failed Frederic Weisbecker
  0 siblings, 2 replies; 7+ messages in thread
From: akpm @ 2011-08-25 20:44 UTC (permalink / raw)
  To: mm-commits; +Cc: bblum, fweisbec, lizf, oleg, paul, tj


The patch titled
     cgroups: fix ordering of calls in cgroup_attach_proc
has been added to the -mm tree.  Its filename is
     cgroups-fix-ordering-of-calls-in-cgroup_attach_proc.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: cgroups: fix ordering of calls in cgroup_attach_proc
From: Ben Blum <bblum@andrew.cmu.edu>

awaiting useful changelog...

Signed-off-by: Ben Blum <bblum@andrew.cmu.edu>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Paul Menage <paul@paulmenage.org>
Cc: Li Zefan <lizf@cn.fujitsu.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 kernel/cgroup.c |   15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff -puN kernel/cgroup.c~cgroups-fix-ordering-of-calls-in-cgroup_attach_proc kernel/cgroup.c
--- a/kernel/cgroup.c~cgroups-fix-ordering-of-calls-in-cgroup_attach_proc
+++ a/kernel/cgroup.c
@@ -2135,14 +2135,17 @@ int cgroup_attach_proc(struct cgroup *cg
 		oldcgrp = task_cgroup_from_root(tsk, root);
 		if (cgrp == oldcgrp)
 			continue;
-		/* attach each task to each subsystem */
-		for_each_subsys(root, ss) {
-			if (ss->attach_task)
-				ss->attach_task(cgrp, tsk);
-		}
 		/* if the thread is PF_EXITING, it can just get skipped. */
 		retval = cgroup_task_migrate(cgrp, oldcgrp, tsk, true);
-		BUG_ON(retval != 0 && retval != -ESRCH);
+		if (retval == 0) {
+			/* attach each task to each subsystem */
+			for_each_subsys(root, ss) {
+				if (ss->attach_task)
+					ss->attach_task(cgrp, tsk);
+			}
+		} else {
+			BUG_ON(retval != -ESRCH);
+		}
 	}
 	/* nothing is sensitive to fork() after this point. */
 
_

Patches currently in -mm which might be from bblum@andrew.cmu.edu are

cgroups-fix-ordering-of-calls-in-cgroup_attach_proc.patch


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-08-26 17:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-25 20:44 + cgroups-fix-ordering-of-calls-in-cgroup_attach_proc.patch added to -mm tree akpm
2011-08-26 15:12 ` Oleg Nesterov
2011-08-26 15:18   ` Paul Menage
2011-08-26 15:21   ` Tejun Heo
2011-08-26 15:50     ` Oleg Nesterov
2011-08-26 15:38 ` [PATCH v2] cgroups: Don't attach task to subsystem if migration failed Frederic Weisbecker
2011-08-26 17:01   ` Ben Blum

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.