Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 189389
b: refs/heads/master
c: 5a7aadf
h: refs/heads/master
i:
  189387: cef5505
v: v3
  • Loading branch information
Matt Helsley authored and Rafael J. Wysocki committed Mar 26, 2010
1 parent d5ec7a9 commit 15c53c1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4f598458ea4450f53e8ed929ee4e66b3404a7286
refs/heads/master: 5a7aadfe2fcb0f69e2acc1fbefe22a096e792fc9
7 changes: 5 additions & 2 deletions trunk/include/linux/freezer.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,12 @@ extern bool freeze_task(struct task_struct *p, bool sig_only);
extern void cancel_freezing(struct task_struct *p);

#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 */
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 */

/*
Expand Down
9 changes: 6 additions & 3 deletions trunk/kernel/cgroup_freezer.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,20 @@ static inline struct freezer *task_freezer(struct task_struct *task)
struct freezer, css);
}

int cgroup_frozen(struct task_struct *task)
int cgroup_freezing_or_frozen(struct task_struct *task)
{
struct freezer *freezer;
enum freezer_state state;

task_lock(task);
freezer = task_freezer(task);
state = freezer->state;
if (!freezer->css.cgroup->parent)
state = CGROUP_THAWED; /* root cgroup can't be frozen */
else
state = freezer->state;
task_unlock(task);

return state == CGROUP_FROZEN;
return (state == CGROUP_FREEZING) || (state == CGROUP_FROZEN);
}

/*
Expand Down
2 changes: 1 addition & 1 deletion trunk/kernel/power/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ static void thaw_tasks(bool nosig_only)
if (nosig_only && should_send_signal(p))
continue;

if (cgroup_frozen(p))
if (cgroup_freezing_or_frozen(p))
continue;

thaw_process(p);
Expand Down

0 comments on commit 15c53c1

Please sign in to comment.