]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branch 'cgroup/for-next'
authorStephen Rothwell <sfr@canb.auug.org.au>
Thu, 24 Nov 2011 04:20:03 +0000 (15:20 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 24 Nov 2011 04:20:03 +0000 (15:20 +1100)
Conflicts:
kernel/cgroup_freezer.c

1  2 
kernel/cgroup_freezer.c

index e411a60cc2c822cbe94dadae9f5ed05c8863f559,213c0351dad8fc8315d6d79a5bf3706a59c823bd..d990517856db347d4b38b0f5c3247a111f97a7f8
@@@ -145,13 -150,16 +145,20 @@@ static struct cgroup_subsys_state *free
  static void freezer_destroy(struct cgroup_subsys *ss,
                            struct cgroup *cgroup)
  {
 -      kfree(cgroup_freezer(cgroup));
 +      struct freezer *freezer = cgroup_freezer(cgroup);
 +
 +      if (freezer->state != CGROUP_THAWED)
 +              atomic_dec(&system_freezing_cnt);
 +      kfree(freezer);
  }
  
+ /* task is frozen or will freeze immediately when next it gets woken */
+ static bool is_task_frozen_enough(struct task_struct *task)
+ {
+       return frozen(task) ||
+               (task_is_stopped_or_traced(task) && freezing(task));
+ }
  /*
   * The call to cgroup_lock() in the freezer.state write method prevents
   * a write to that file racing against an attach, and hence the
@@@ -272,11 -286,12 +279,11 @@@ static int try_to_freeze_cgroup(struct 
        struct task_struct *task;
        unsigned int num_cant_freeze_now = 0;
  
 -      freezer->state = CGROUP_FREEZING;
        cgroup_iter_start(cgroup, &it);
        while ((task = cgroup_iter_next(cgroup, &it))) {
 -              if (!freeze_task(task, true))
 +              if (!freeze_task(task))
                        continue;
-               if (frozen(task))
+               if (is_task_frozen_enough(task))
                        continue;
                if (!freezing(task) && !freezer_should_skip(task))
                        num_cant_freeze_now++;