|
@@ -5190,8 +5190,8 @@ static void task_tick_fair(struct rq *rq, struct task_struct *curr, int queued)
|
|
|
*/
|
|
|
static void task_fork_fair(struct task_struct *p)
|
|
|
{
|
|
|
- struct cfs_rq *cfs_rq = task_cfs_rq(current);
|
|
|
- struct sched_entity *se = &p->se, *curr = cfs_rq->curr;
|
|
|
+ struct cfs_rq *cfs_rq;
|
|
|
+ struct sched_entity *se = &p->se, *curr;
|
|
|
int this_cpu = smp_processor_id();
|
|
|
struct rq *rq = this_rq();
|
|
|
unsigned long flags;
|
|
@@ -5200,6 +5200,9 @@ static void task_fork_fair(struct task_struct *p)
|
|
|
|
|
|
update_rq_clock(rq);
|
|
|
|
|
|
+ cfs_rq = task_cfs_rq(current);
|
|
|
+ curr = cfs_rq->curr;
|
|
|
+
|
|
|
if (unlikely(task_cpu(p) != this_cpu)) {
|
|
|
rcu_read_lock();
|
|
|
__set_task_cpu(p, this_cpu);
|