mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-03 07:41:40 +00:00
Merge branch 'for-3.2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
* 'for-3.2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: cgroup_freezer: fix freezing groups with stopped tasks
This commit is contained in:
commit
a34815b96f
@ -153,6 +153,13 @@ static void freezer_destroy(struct cgroup_subsys *ss,
|
|||||||
kfree(cgroup_freezer(cgroup));
|
kfree(cgroup_freezer(cgroup));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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
|
* The call to cgroup_lock() in the freezer.state write method prevents
|
||||||
* a write to that file racing against an attach, and hence the
|
* a write to that file racing against an attach, and hence the
|
||||||
@ -231,7 +238,7 @@ static void update_if_frozen(struct cgroup *cgroup,
|
|||||||
cgroup_iter_start(cgroup, &it);
|
cgroup_iter_start(cgroup, &it);
|
||||||
while ((task = cgroup_iter_next(cgroup, &it))) {
|
while ((task = cgroup_iter_next(cgroup, &it))) {
|
||||||
ntotal++;
|
ntotal++;
|
||||||
if (frozen(task))
|
if (is_task_frozen_enough(task))
|
||||||
nfrozen++;
|
nfrozen++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -284,7 +291,7 @@ static int try_to_freeze_cgroup(struct cgroup *cgroup, struct freezer *freezer)
|
|||||||
while ((task = cgroup_iter_next(cgroup, &it))) {
|
while ((task = cgroup_iter_next(cgroup, &it))) {
|
||||||
if (!freeze_task(task, true))
|
if (!freeze_task(task, true))
|
||||||
continue;
|
continue;
|
||||||
if (frozen(task))
|
if (is_task_frozen_enough(task))
|
||||||
continue;
|
continue;
|
||||||
if (!freezing(task) && !freezer_should_skip(task))
|
if (!freezing(task) && !freezer_should_skip(task))
|
||||||
num_cant_freeze_now++;
|
num_cant_freeze_now++;
|
||||||
|
Loading…
Reference in New Issue
Block a user