projects
/
deliverable
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cgroups: let ss->can_attach and ss->attach do whole threadgroups at a time
[deliverable/linux.git]
/
kernel
/
cgroup_freezer.c
diff --git
a/kernel/cgroup_freezer.c
b/kernel/cgroup_freezer.c
index fb249e2bcada880a19105488c7fdde33e9483126..59e9ef6aab4002e1d99170f50156e733e8f46343 100644
(file)
--- a/
kernel/cgroup_freezer.c
+++ b/
kernel/cgroup_freezer.c
@@
-159,7
+159,7
@@
static bool is_task_frozen_enough(struct task_struct *task)
*/
static int freezer_can_attach(struct cgroup_subsys *ss,
struct cgroup *new_cgroup,
*/
static int freezer_can_attach(struct cgroup_subsys *ss,
struct cgroup *new_cgroup,
- struct task_struct *task)
+ struct task_struct *task
, bool threadgroup
)
{
struct freezer *freezer;
{
struct freezer *freezer;
@@
-177,6
+177,19
@@
static int freezer_can_attach(struct cgroup_subsys *ss,
if (freezer->state == CGROUP_FROZEN)
return -EBUSY;
if (freezer->state == CGROUP_FROZEN)
return -EBUSY;
+ if (threadgroup) {
+ struct task_struct *c;
+
+ rcu_read_lock();
+ list_for_each_entry_rcu(c, &task->thread_group, thread_group) {
+ if (is_task_frozen_enough(c)) {
+ rcu_read_unlock();
+ return -EBUSY;
+ }
+ }
+ rcu_read_unlock();
+ }
+
return 0;
}
return 0;
}
This page took
0.02468 seconds
and
5
git commands to generate.