aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched/fair.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched/fair.c')
-rw-r--r--kernel/sched/fair.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 9b3fe1cd8f40..11cd13667359 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5928,11 +5928,15 @@ static void task_fork_fair(struct task_struct *p)
5928 cfs_rq = task_cfs_rq(current); 5928 cfs_rq = task_cfs_rq(current);
5929 curr = cfs_rq->curr; 5929 curr = cfs_rq->curr;
5930 5930
5931 if (unlikely(task_cpu(p) != this_cpu)) { 5931 /*
5932 rcu_read_lock(); 5932 * Not only the cpu but also the task_group of the parent might have
5933 __set_task_cpu(p, this_cpu); 5933 * been changed after parent->se.parent,cfs_rq were copied to
5934 rcu_read_unlock(); 5934 * child->se.parent,cfs_rq. So call __set_task_cpu() to make those
5935 } 5935 * of child point to valid ones.
5936 */
5937 rcu_read_lock();
5938 __set_task_cpu(p, this_cpu);
5939 rcu_read_unlock();
5936 5940
5937 update_curr(cfs_rq); 5941 update_curr(cfs_rq);
5938 5942