diff options
author | Ingo Molnar <mingo@elte.hu> | 2007-08-02 11:41:40 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2007-08-02 11:41:40 -0400 |
commit | cad60d93e18ba52b6f069b2edb031c89bf603b07 (patch) | |
tree | dfe74c165e7607c233d223614ef400163c6ba44c /kernel/sched.c | |
parent | 4e6f96f313561d86d248edf0eaff2336d8217e1b (diff) |
[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) | |||
1641 | unsigned long flags; | 1641 | unsigned long flags; |
1642 | struct rq *rq; | 1642 | struct rq *rq; |
1643 | int this_cpu; | 1643 | int this_cpu; |
1644 | u64 now; | ||
1644 | 1645 | ||
1645 | rq = task_rq_lock(p, &flags); | 1646 | rq = task_rq_lock(p, &flags); |
1646 | BUG_ON(p->state != TASK_RUNNING); | 1647 | BUG_ON(p->state != TASK_RUNNING); |
1647 | this_cpu = smp_processor_id(); /* parent's CPU */ | 1648 | this_cpu = smp_processor_id(); /* parent's CPU */ |
1649 | now = rq_clock(rq); | ||
1648 | 1650 | ||
1649 | p->prio = effective_prio(p); | 1651 | p->prio = effective_prio(p); |
1650 | 1652 | ||
1651 | if (!sysctl_sched_child_runs_first || (clone_flags & CLONE_VM) || | 1653 | if (!p->sched_class->task_new || !sysctl_sched_child_runs_first || |
1652 | task_cpu(p) != this_cpu || !current->se.on_rq) { | 1654 | (clone_flags & CLONE_VM) || task_cpu(p) != this_cpu || |
1655 | !current->se.on_rq) { | ||
1656 | |||
1653 | activate_task(rq, p, 0); | 1657 | activate_task(rq, p, 0); |
1654 | } else { | 1658 | } else { |
1655 | /* | 1659 | /* |
1656 | * Let the scheduling class do new task startup | 1660 | * Let the scheduling class do new task startup |
1657 | * management (if any): | 1661 | * management (if any): |
1658 | */ | 1662 | */ |
1659 | p->sched_class->task_new(rq, p); | 1663 | p->sched_class->task_new(rq, p, now); |
1664 | inc_nr_running(p, rq, now); | ||
1660 | } | 1665 | } |
1661 | check_preempt_curr(rq, p); | 1666 | check_preempt_curr(rq, p); |
1662 | task_rq_unlock(rq, &flags); | 1667 | task_rq_unlock(rq, &flags); |