aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/sched.c5
-rw-r--r--kernel/sched_fair.c3
2 files changed, 3 insertions, 5 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index f2b8db4d6802..b41ef663b993 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1660,17 +1660,14 @@ void fastcall wake_up_new_task(struct task_struct *p, unsigned long clone_flags)
1660{ 1660{
1661 unsigned long flags; 1661 unsigned long flags;
1662 struct rq *rq; 1662 struct rq *rq;
1663 int this_cpu;
1664 1663
1665 rq = task_rq_lock(p, &flags); 1664 rq = task_rq_lock(p, &flags);
1666 BUG_ON(p->state != TASK_RUNNING); 1665 BUG_ON(p->state != TASK_RUNNING);
1667 this_cpu = smp_processor_id(); /* parent's CPU */
1668 update_rq_clock(rq); 1666 update_rq_clock(rq);
1669 1667
1670 p->prio = effective_prio(p); 1668 p->prio = effective_prio(p);
1671 1669
1672 if (task_cpu(p) != this_cpu || !p->sched_class->task_new || 1670 if (!p->sched_class->task_new || !current->se.on_rq || !rq->cfs.curr) {
1673 !current->se.on_rq) {
1674 activate_task(rq, p, 0); 1671 activate_task(rq, p, 0);
1675 } else { 1672 } else {
1676 /* 1673 /*
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index a9dfb7746c5c..f5f491762e35 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -1007,13 +1007,14 @@ static void task_new_fair(struct rq *rq, struct task_struct *p)
1007{ 1007{
1008 struct cfs_rq *cfs_rq = task_cfs_rq(p); 1008 struct cfs_rq *cfs_rq = task_cfs_rq(p);
1009 struct sched_entity *se = &p->se, *curr = cfs_rq->curr; 1009 struct sched_entity *se = &p->se, *curr = cfs_rq->curr;
1010 int this_cpu = smp_processor_id();
1010 1011
1011 sched_info_queued(p); 1012 sched_info_queued(p);
1012 1013
1013 update_curr(cfs_rq); 1014 update_curr(cfs_rq);
1014 place_entity(cfs_rq, se, 1); 1015 place_entity(cfs_rq, se, 1);
1015 1016
1016 if (sysctl_sched_child_runs_first && 1017 if (sysctl_sched_child_runs_first && this_cpu == task_cpu(p) &&
1017 curr->vruntime < se->vruntime) { 1018 curr->vruntime < se->vruntime) {
1018 /* 1019 /*
1019 * Upon rescheduling, sched_class::put_prev_task() will place 1020 * Upon rescheduling, sched_class::put_prev_task() will place