diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index db3f674ca49d..5f996d36ac5d 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c @@ -3751,8 +3751,11 @@ static void task_fork_fair(struct task_struct *p) update_rq_clock(rq); - if (unlikely(task_cpu(p) != this_cpu)) + if (unlikely(task_cpu(p) != this_cpu)) { + rcu_read_lock(); __set_task_cpu(p, this_cpu); + rcu_read_unlock(); + } update_curr(cfs_rq);