Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304801
b: refs/heads/master
c: c4c27fb
h: refs/heads/master
i:
  304799: 991e46a
v: v3
  • Loading branch information
Mike Galbraith authored and Tejun Heo committed Apr 23, 2012
1 parent 6c46055 commit 1e7ff31
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 86f82d561864e902c70282b6f17cf590c0f34691
refs/heads/master: c4c27fbdda4e8ba87806c415b6d15266b07bce4b
13 changes: 13 additions & 0 deletions trunk/kernel/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
#include <linux/eventfd.h>
#include <linux/poll.h>
#include <linux/flex_array.h> /* used in cgroup_attach_proc */
#include <linux/kthread.h>

#include <linux/atomic.h>

Expand Down Expand Up @@ -2225,6 +2226,18 @@ static int attach_task_by_pid(struct cgroup *cgrp, u64 pid, bool threadgroup)

if (threadgroup)
tsk = tsk->group_leader;

/*
* Workqueue threads may acquire PF_THREAD_BOUND and become
* trapped in a cpuset, or RT worker may be born in a cgroup
* with no rt_runtime allocated. Just say no.
*/
if (tsk == kthreadd_task || (tsk->flags & PF_THREAD_BOUND)) {
ret = -EINVAL;
rcu_read_unlock();
goto out_unlock_cgroup;
}

get_task_struct(tsk);
rcu_read_unlock();

Expand Down

0 comments on commit 1e7ff31

Please sign in to comment.