Commit 24b99d15 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6

* 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
  Freezer: Fix buggy resume test for tasks frozen with cgroup freezer
  Freezer: Only show the state of tasks refusing to freeze
parents 6da8d866 5a7aadfe
...@@ -64,9 +64,12 @@ extern bool freeze_task(struct task_struct *p, bool sig_only); ...@@ -64,9 +64,12 @@ extern bool freeze_task(struct task_struct *p, bool sig_only);
extern void cancel_freezing(struct task_struct *p); extern void cancel_freezing(struct task_struct *p);
#ifdef CONFIG_CGROUP_FREEZER #ifdef CONFIG_CGROUP_FREEZER
extern int cgroup_frozen(struct task_struct *task); extern int cgroup_freezing_or_frozen(struct task_struct *task);
#else /* !CONFIG_CGROUP_FREEZER */ #else /* !CONFIG_CGROUP_FREEZER */
static inline int cgroup_frozen(struct task_struct *task) { return 0; } static inline int cgroup_freezing_or_frozen(struct task_struct *task)
{
return 0;
}
#endif /* !CONFIG_CGROUP_FREEZER */ #endif /* !CONFIG_CGROUP_FREEZER */
/* /*
......
...@@ -47,17 +47,20 @@ static inline struct freezer *task_freezer(struct task_struct *task) ...@@ -47,17 +47,20 @@ static inline struct freezer *task_freezer(struct task_struct *task)
struct freezer, css); struct freezer, css);
} }
int cgroup_frozen(struct task_struct *task) int cgroup_freezing_or_frozen(struct task_struct *task)
{ {
struct freezer *freezer; struct freezer *freezer;
enum freezer_state state; enum freezer_state state;
task_lock(task); task_lock(task);
freezer = task_freezer(task); freezer = task_freezer(task);
if (!freezer->css.cgroup->parent)
state = CGROUP_THAWED; /* root cgroup can't be frozen */
else
state = freezer->state; state = freezer->state;
task_unlock(task); task_unlock(task);
return state == CGROUP_FROZEN; return (state == CGROUP_FREEZING) || (state == CGROUP_FROZEN);
} }
/* /*
......
...@@ -88,12 +88,11 @@ static int try_to_freeze_tasks(bool sig_only) ...@@ -88,12 +88,11 @@ static int try_to_freeze_tasks(bool sig_only)
printk(KERN_ERR "Freezing of tasks failed after %d.%02d seconds " printk(KERN_ERR "Freezing of tasks failed after %d.%02d seconds "
"(%d tasks refusing to freeze):\n", "(%d tasks refusing to freeze):\n",
elapsed_csecs / 100, elapsed_csecs % 100, todo); elapsed_csecs / 100, elapsed_csecs % 100, todo);
show_state();
read_lock(&tasklist_lock); read_lock(&tasklist_lock);
do_each_thread(g, p) { do_each_thread(g, p) {
task_lock(p); task_lock(p);
if (freezing(p) && !freezer_should_skip(p)) if (freezing(p) && !freezer_should_skip(p))
printk(KERN_ERR " %s\n", p->comm); sched_show_task(p);
cancel_freezing(p); cancel_freezing(p);
task_unlock(p); task_unlock(p);
} while_each_thread(g, p); } while_each_thread(g, p);
...@@ -145,7 +144,7 @@ static void thaw_tasks(bool nosig_only) ...@@ -145,7 +144,7 @@ static void thaw_tasks(bool nosig_only)
if (nosig_only && should_send_signal(p)) if (nosig_only && should_send_signal(p))
continue; continue;
if (cgroup_frozen(p)) if (cgroup_freezing_or_frozen(p))
continue; continue;
thaw_process(p); thaw_process(p);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment