Messages in this thread | | | Date | Tue, 28 Oct 2014 00:04:27 +0100 | From | Oleg Nesterov <> | Subject | Re: [PATCH] sched: Fix race between task_group and sched_task_group |
| |
On 10/27, Kirill Tkhai wrote: > > +static void cpu_cgroup_fork(struct task_struct *task) > +{ > + sched_move_task(task); > +} > + > static int cpu_cgroup_can_attach(struct cgroup_subsys_state *css, > struct cgroup_taskset *tset) > { > @@ -8205,6 +8210,7 @@ struct cgroup_subsys cpu_cgrp_subsys = { > .css_free = cpu_cgroup_css_free, > .css_online = cpu_cgroup_css_online, > .css_offline = cpu_cgroup_css_offline, > + .fork = cpu_cgroup_fork,
Agreed, but it seems that sched_move_task() -> task_css_check() can complain if CONFIG_PROVE_RCU...
cpu_cgroup_exit() too calls sched_move_task() without any lock, but there is the PF_EXITING check and init_css_set can't go away.
perhaps sched_move_task() should just take rcu_read_lock() and use task_css() ? This lockdep_is_held(siglock) looks ugly, and iiuc we need it to shut up the warning if autogroup_move_group() is the caller.
Oleg.
| |