]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge branch 'cgroup/for-3.7-fixes' into cgroup/for-3.8
authorTejun Heo <tj@kernel.org>
Tue, 6 Nov 2012 20:26:23 +0000 (12:26 -0800)
committerTejun Heo <tj@kernel.org>
Tue, 6 Nov 2012 20:26:23 +0000 (12:26 -0800)
This is to receive device_cgroup fixes so that further device_cgroup
changes can be made in cgroup/for-3.8.

Signed-off-by: Tejun Heo <tj@kernel.org>
1  2 
block/blk-cgroup.c
kernel/cgroup.c

Simple merge
diff --cc kernel/cgroup.c
index e3045ad4267a94fed84a99c84ab6b5f36b3fd436,f24f724620dd8489fc2e3cb9781433df84096c96..3070164e203663c89848840c6dda8029a3829e02
@@@ -4736,45 -4883,13 +4724,36 @@@ void cgroup_post_fork(struct task_struc
         */
        if (use_task_css_set_links) {
                write_lock(&css_set_lock);
-               if (list_empty(&child->cg_list)) {
-                       /*
-                        * It's safe to use child->cgroups without task_lock()
-                        * here because we are protected through
-                        * threadgroup_change_begin() against concurrent
-                        * css_set change in cgroup_task_migrate(). Also
-                        * the task can't exit at that point until
-                        * wake_up_new_task() is called, so we are protected
-                        * against cgroup_exit() setting child->cgroup to
-                        * init_css_set.
-                        */
+               task_lock(child);
+               if (list_empty(&child->cg_list))
                        list_add(&child->cg_list, &child->cgroups->tasks);
-               }
+               task_unlock(child);
                write_unlock(&css_set_lock);
        }
 +
 +      /*
 +       * Call ss->fork().  This must happen after @child is linked on
 +       * css_set; otherwise, @child might change state between ->fork()
 +       * and addition to css_set.
 +       */
 +      if (need_forkexit_callback) {
 +              for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
 +                      struct cgroup_subsys *ss = subsys[i];
 +
 +                      /*
 +                       * fork/exit callbacks are supported only for
 +                       * builtin subsystems and we don't need further
 +                       * synchronization as they never go away.
 +                       */
 +                      if (!ss || ss->module)
 +                              continue;
 +
 +                      if (ss->fork)
 +                              ss->fork(child);
 +              }
 +      }
  }
 +
  /**
   * cgroup_exit - detach cgroup from exiting task
   * @tsk: pointer to task_struct of exiting process