Merge branch 'for-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
* 'for-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: (21 commits)
cgroup: fix to allow mounting a hierarchy by name
cgroup: move assignement out of condition in cgroup_attach_proc()
cgroup: Remove task_lock() from cgroup_post_fork()
cgroup: add sparse annotation to cgroup_iter_start() and cgroup_iter_end()
cgroup: mark cgroup_rmdir_waitq and cgroup_attach_proc() as static
cgroup: only need to check oldcgrp==newgrp once
cgroup: remove redundant get/put of task struct
cgroup: remove redundant get/put of old css_set from migrate
cgroup: Remove unnecessary task_lock before fetching css_set on migration
cgroup: Drop task_lock(parent) on cgroup_fork()
cgroups: remove redundant get/put of css_set from css_set_check_fetched()
resource cgroups: remove bogus cast
cgroup: kill subsys->can_attach_task(), pre_attach() and attach_task()
cgroup, cpuset: don't use ss->pre_attach()
cgroup: don't use subsys->can_attach_task() or ->attach_task()
cgroup: introduce cgroup_taskset and use it in subsys->can_attach(), cancel_attach() and attach()
cgroup: improve old cgroup handling in cgroup_attach_proc()
cgroup: always lock threadgroup during migration
threadgroup: extend threadgroup_lock() to cover exit and exec
threadgroup: rename signal->threadgroup_fork_lock to ->group_rwsem
...
Fix up conflict in kernel/cgroup.c due to commit e0197aae59
: "cgroups:
fix a css_set not found bug in cgroup_attach_proc" that already
mentioned that the bug is fixed (differently) in Tejun's cgroup
patchset. This one, in other words.
This commit is contained in:
@@ -7563,24 +7563,31 @@ cpu_cgroup_destroy(struct cgroup_subsys *ss, struct cgroup *cgrp)
|
||||
sched_destroy_group(tg);
|
||||
}
|
||||
|
||||
static int
|
||||
cpu_cgroup_can_attach_task(struct cgroup *cgrp, struct task_struct *tsk)
|
||||
static int cpu_cgroup_can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
|
||||
struct cgroup_taskset *tset)
|
||||
{
|
||||
struct task_struct *task;
|
||||
|
||||
cgroup_taskset_for_each(task, cgrp, tset) {
|
||||
#ifdef CONFIG_RT_GROUP_SCHED
|
||||
if (!sched_rt_can_attach(cgroup_tg(cgrp), tsk))
|
||||
return -EINVAL;
|
||||
if (!sched_rt_can_attach(cgroup_tg(cgrp), task))
|
||||
return -EINVAL;
|
||||
#else
|
||||
/* We don't support RT-tasks being in separate groups */
|
||||
if (tsk->sched_class != &fair_sched_class)
|
||||
return -EINVAL;
|
||||
/* We don't support RT-tasks being in separate groups */
|
||||
if (task->sched_class != &fair_sched_class)
|
||||
return -EINVAL;
|
||||
#endif
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
cpu_cgroup_attach_task(struct cgroup *cgrp, struct task_struct *tsk)
|
||||
static void cpu_cgroup_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
|
||||
struct cgroup_taskset *tset)
|
||||
{
|
||||
sched_move_task(tsk);
|
||||
struct task_struct *task;
|
||||
|
||||
cgroup_taskset_for_each(task, cgrp, tset)
|
||||
sched_move_task(task);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -7915,8 +7922,8 @@ struct cgroup_subsys cpu_cgroup_subsys = {
|
||||
.name = "cpu",
|
||||
.create = cpu_cgroup_create,
|
||||
.destroy = cpu_cgroup_destroy,
|
||||
.can_attach_task = cpu_cgroup_can_attach_task,
|
||||
.attach_task = cpu_cgroup_attach_task,
|
||||
.can_attach = cpu_cgroup_can_attach,
|
||||
.attach = cpu_cgroup_attach,
|
||||
.exit = cpu_cgroup_exit,
|
||||
.populate = cpu_cgroup_populate,
|
||||
.subsys_id = cpu_cgroup_subsys_id,
|
||||
|
Reference in New Issue
Block a user