aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index df6579d9b4df..0bba34a48d10 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -5337,7 +5337,19 @@ void __cpuinit init_idle(struct task_struct *idle, int cpu)
5337 idle->se.exec_start = sched_clock(); 5337 idle->se.exec_start = sched_clock();
5338 5338
5339 cpumask_copy(&idle->cpus_allowed, cpumask_of(cpu)); 5339 cpumask_copy(&idle->cpus_allowed, cpumask_of(cpu));
5340 /*
5341 * We're having a chicken and egg problem, even though we are
5342 * holding rq->lock, the cpu isn't yet set to this cpu so the
5343 * lockdep check in task_group() will fail.
5344 *
5345 * Similar case to sched_fork(). / Alternatively we could
5346 * use task_rq_lock() here and obtain the other rq->lock.
5347 *
5348 * Silence PROVE_RCU
5349 */
5350 rcu_read_lock();
5340 __set_task_cpu(idle, cpu); 5351 __set_task_cpu(idle, cpu);
5352 rcu_read_unlock();
5341 5353
5342 rq->curr = rq->idle = idle; 5354 rq->curr = rq->idle = idle;
5343#if defined(CONFIG_SMP) && defined(__ARCH_WANT_UNLOCKED_CTXSW) 5355#if defined(CONFIG_SMP) && defined(__ARCH_WANT_UNLOCKED_CTXSW)