X-Git-Url: https://bbs.cooldavid.org/git/?a=blobdiff_plain;f=kernel%2Fsched.c;h=f52a8801b7a285fb252ecc6935b55f525813881b;hb=123f94f22e3d283dfe68742b269c245b0501ad82;hp=f87abe3b0176613d03d722b4ed74fc56f3597dfa;hpb=8c215bd3890c347dfb6a2db4779755f8b9c298a9;p=net-next-2.6.git diff --git a/kernel/sched.c b/kernel/sched.c index f87abe3b017..f52a8801b7a 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -2494,7 +2494,16 @@ void sched_fork(struct task_struct *p, int clone_flags) if (p->sched_class->task_fork) p->sched_class->task_fork(p); + /* + * The child is not yet in the pid-hash so no cgroup attach races, + * and the cgroup is pinned to this child due to cgroup_fork() + * is ran before sched_fork(). + * + * Silence PROVE_RCU. + */ + rcu_read_lock(); set_task_cpu(p, cpu); + rcu_read_unlock(); #if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) if (likely(sched_info_on()))