|
@@ -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()))
|