From 56ec095321a04670553efb4a9fe1f6a2558de5ab Mon Sep 17 00:00:00 2001 From: Srivatsa Vaddagiri Date: Fri, 9 Nov 2007 22:39:39 +0100 Subject: [PATCH] --- yaml --- r: 73407 b: refs/heads/master c: 3c90e6e99b08f01d5684a3a07cceae6a543e4fa8 h: refs/heads/master i: 73405: f29c9e19eda616db42aee0f7e42de55c543cff85 73403: 05e05b22b8ef71144e427cf6db8a04a279d4e35b 73399: 7a98f08579b0fd1d1663d83a3a0d4938da5afa7b 73391: a7814db8c7dc413ac396cd2c8e8975758660b8d8 73375: 1063f928c20b02584812ab131525d53fba76ddc9 73343: 0e75578b3b44ddffd06621ff373cafc93821660b v: v3 --- [refs] | 2 +- trunk/kernel/fork.c | 6 +++--- trunk/kernel/sched_fair.c | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 97e81e691884..0e103fb0e10c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 502d26b524d8980f3ed80d9aec398e85671a8160 +refs/heads/master: 3c90e6e99b08f01d5684a3a07cceae6a543e4fa8 diff --git a/trunk/kernel/fork.c b/trunk/kernel/fork.c index 28a740151988..8ca1a14cdc8c 100644 --- a/trunk/kernel/fork.c +++ b/trunk/kernel/fork.c @@ -1123,6 +1123,9 @@ static struct task_struct *copy_process(unsigned long clone_flags, p->blocked_on = NULL; /* not blocked yet */ #endif + /* Perform scheduler related setup. Assign this task to a CPU. */ + sched_fork(p, clone_flags); + if ((retval = security_task_alloc(p))) goto bad_fork_cleanup_policy; if ((retval = audit_alloc(p))) @@ -1212,9 +1215,6 @@ static struct task_struct *copy_process(unsigned long clone_flags, INIT_LIST_HEAD(&p->ptrace_children); INIT_LIST_HEAD(&p->ptrace_list); - /* Perform scheduler related setup. Assign this task to a CPU. */ - sched_fork(p, clone_flags); - /* Now that the task is set up, run cgroup callbacks if * necessary. We need to run them before the task is visible * on the tasklist. */ diff --git a/trunk/kernel/sched_fair.c b/trunk/kernel/sched_fair.c index 6c361472cc74..d3c03070872d 100644 --- a/trunk/kernel/sched_fair.c +++ b/trunk/kernel/sched_fair.c @@ -1067,8 +1067,9 @@ static void task_new_fair(struct rq *rq, struct task_struct *p) update_curr(cfs_rq); place_entity(cfs_rq, se, 1); + /* 'curr' will be NULL if the child belongs to a different group */ if (sysctl_sched_child_runs_first && this_cpu == task_cpu(p) && - curr->vruntime < se->vruntime) { + curr && curr->vruntime < se->vruntime) { /* * Upon rescheduling, sched_class::put_prev_task() will place * 'current' within the tree based on its new key value.