diff options
author | Ingo Molnar <mingo@elte.hu> | 2007-08-02 17:41:40 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2007-08-02 17:41:40 +0200 |
commit | cad60d93e18ba52b6f069b2edb031c89bf603b07 (patch) | |
tree | dfe74c165e7607c233d223614ef400163c6ba44c /kernel/sched.c | |
parent | 4e6f96f313561d86d248edf0eaff2336d8217e1b (diff) | |
download | lwn-cad60d93e18ba52b6f069b2edb031c89bf603b07.tar.gz lwn-cad60d93e18ba52b6f069b2edb031c89bf603b07.zip |
[PATCH] sched: ->task_new cleanup
make sched_class.task_new == NULL a 'default method', this
allows the removal of task_rt_new.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 7bed2c58b986..915c75e5a276 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -1641,22 +1641,27 @@ void fastcall wake_up_new_task(struct task_struct *p, unsigned long clone_flags) unsigned long flags; struct rq *rq; int this_cpu; + u64 now; rq = task_rq_lock(p, &flags); BUG_ON(p->state != TASK_RUNNING); this_cpu = smp_processor_id(); /* parent's CPU */ + now = rq_clock(rq); p->prio = effective_prio(p); - if (!sysctl_sched_child_runs_first || (clone_flags & CLONE_VM) || - task_cpu(p) != this_cpu || !current->se.on_rq) { + if (!p->sched_class->task_new || !sysctl_sched_child_runs_first || + (clone_flags & CLONE_VM) || task_cpu(p) != this_cpu || + !current->se.on_rq) { + activate_task(rq, p, 0); } else { /* * Let the scheduling class do new task startup * management (if any): */ - p->sched_class->task_new(rq, p); + p->sched_class->task_new(rq, p, now); + inc_nr_running(p, rq, now); } check_preempt_curr(rq, p); task_rq_unlock(rq, &flags); |