diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/fork.c | 6 | ||||
-rw-r--r-- | kernel/sched_fair.c | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index 28a740151988..8ca1a14cdc8c 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -1123,6 +1123,9 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
1123 | p->blocked_on = NULL; /* not blocked yet */ | 1123 | p->blocked_on = NULL; /* not blocked yet */ |
1124 | #endif | 1124 | #endif |
1125 | 1125 | ||
1126 | /* Perform scheduler related setup. Assign this task to a CPU. */ | ||
1127 | sched_fork(p, clone_flags); | ||
1128 | |||
1126 | if ((retval = security_task_alloc(p))) | 1129 | if ((retval = security_task_alloc(p))) |
1127 | goto bad_fork_cleanup_policy; | 1130 | goto bad_fork_cleanup_policy; |
1128 | if ((retval = audit_alloc(p))) | 1131 | if ((retval = audit_alloc(p))) |
@@ -1212,9 +1215,6 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
1212 | INIT_LIST_HEAD(&p->ptrace_children); | 1215 | INIT_LIST_HEAD(&p->ptrace_children); |
1213 | INIT_LIST_HEAD(&p->ptrace_list); | 1216 | INIT_LIST_HEAD(&p->ptrace_list); |
1214 | 1217 | ||
1215 | /* Perform scheduler related setup. Assign this task to a CPU. */ | ||
1216 | sched_fork(p, clone_flags); | ||
1217 | |||
1218 | /* Now that the task is set up, run cgroup callbacks if | 1218 | /* Now that the task is set up, run cgroup callbacks if |
1219 | * necessary. We need to run them before the task is visible | 1219 | * necessary. We need to run them before the task is visible |
1220 | * on the tasklist. */ | 1220 | * on the tasklist. */ |
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 6c361472cc74..d3c03070872d 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
@@ -1067,8 +1067,9 @@ static void task_new_fair(struct rq *rq, struct task_struct *p) | |||
1067 | update_curr(cfs_rq); | 1067 | update_curr(cfs_rq); |
1068 | place_entity(cfs_rq, se, 1); | 1068 | place_entity(cfs_rq, se, 1); |
1069 | 1069 | ||
1070 | /* 'curr' will be NULL if the child belongs to a different group */ | ||
1070 | if (sysctl_sched_child_runs_first && this_cpu == task_cpu(p) && | 1071 | if (sysctl_sched_child_runs_first && this_cpu == task_cpu(p) && |
1071 | curr->vruntime < se->vruntime) { | 1072 | curr && curr->vruntime < se->vruntime) { |
1072 | /* | 1073 | /* |
1073 | * Upon rescheduling, sched_class::put_prev_task() will place | 1074 | * Upon rescheduling, sched_class::put_prev_task() will place |
1074 | * 'current' within the tree based on its new key value. | 1075 | * 'current' within the tree based on its new key value. |