aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2010-06-22 05:44:53 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2010-06-23 18:14:09 -0400
commit8695159967957015f8dfb49315d6f88e111d90e0 (patch)
treed575083d37a069be585d575ec036faa8765f1d0c /kernel/sched.c
parent94bfa3b6692c7a3f6f119596724204ec975d3ef0 (diff)
sched: silence PROVE_RCU in sched_fork()
Because cgroup_fork() is ran before sched_fork() [ from copy_process() ] and the child's pid is not yet visible the child is pinned to its cgroup. Therefore we can silence this warning. A nicer solution would be moving cgroup_fork() to right after dup_task_struct() and exclude PF_STARTING from task_subsys_state(). Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Reviewed-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index f8b8996228dd..a2d215d132f6 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2494,7 +2494,16 @@ void sched_fork(struct task_struct *p, int clone_flags)
2494 if (p->sched_class->task_fork) 2494 if (p->sched_class->task_fork)
2495 p->sched_class->task_fork(p); 2495 p->sched_class->task_fork(p);
2496 2496
2497 /*
2498 * The child is not yet in the pid-hash so no cgroup attach races,
2499 * and the cgroup is pinned to this child due to cgroup_fork()
2500 * is ran before sched_fork().
2501 *
2502 * Silence PROVE_RCU.
2503 */
2504 rcu_read_lock();
2497 set_task_cpu(p, cpu); 2505 set_task_cpu(p, cpu);
2506 rcu_read_unlock();
2498 2507
2499#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) 2508#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
2500 if (likely(sched_info_on())) 2509 if (likely(sched_info_on()))