]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge branch 'pm-freezer' into linux-next
authorRafael J. Wysocki <rjw@sisk.pl>
Thu, 1 Dec 2011 21:05:14 +0000 (22:05 +0100)
committerRafael J. Wysocki <rjw@sisk.pl>
Thu, 1 Dec 2011 21:05:14 +0000 (22:05 +0100)
* pm-freezer: (25 commits)
  Freezer: fix more fallout from the thaw_process rename
  freezer: fix wait_event_freezable/__thaw_task races
  freezer: kill unused set_freezable_with_signal()
  dmatest: don't use set_freezable_with_signal()
  usb_storage: don't use set_freezable_with_signal()
  freezer: remove unused @sig_only from freeze_task()
  freezer: use lock_task_sighand() in fake_signal_wake_up()
  freezer: restructure __refrigerator()
  freezer: fix set_freezable[_with_signal]() race
  freezer: remove should_send_signal() and update frozen()
  freezer: remove now unused TIF_FREEZE
  freezer: make freezing() test freeze conditions in effect instead of TIF_FREEZE
  cgroup_freezer: prepare for removal of TIF_FREEZE
  freezer: clean up freeze_processes() failure path
  freezer: kill PF_FREEZING
  freezer: test freezable conditions while holding freezer_lock
  freezer: make freezing indicate freeze condition in effect
  freezer: use dedicated lock instead of task_lock() + memory barrier
  freezer: don't distinguish nosig tasks on thaw
  freezer: remove racy clear_freeze_flag() and set PF_NOFREEZE on dead tasks
  ...

Conflicts:
kernel/cgroup_freezer.c

1  2 
kernel/cgroup_freezer.c
kernel/power/hibernate.c

index 213c0351dad8fc8315d6d79a5bf3706a59c823bd,e411a60cc2c822cbe94dadae9f5ed05c8863f559..46b2ba3f08ef5c439584b007d367691152be9ffc
@@@ -150,16 -145,13 +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
@@@ -238,7 -224,7 +231,7 @@@ static void update_if_frozen(struct cgr
        cgroup_iter_start(cgroup, &it);
        while ((task = cgroup_iter_next(cgroup, &it))) {
                ntotal++;
-               if (is_task_frozen_enough(task))
 -              if (freezing(task) && frozen(task))
++              if (freezing(task) && is_task_frozen_enough(task))
                        nfrozen++;
        }
  
@@@ -286,12 -272,11 +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 (is_task_frozen_enough(task))
 -              if (frozen(task))
++              if (freezing(task) && is_task_frozen_enough(task))
                        continue;
                if (!freezing(task) && !freezer_should_skip(task))
                        num_cant_freeze_now++;
Simple merge