summaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-09-19 15:47:59 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-09-19 15:47:59 -0700
commit097cc62283455668ad0b35c72920c6373f45c2ab (patch)
tree36555397fabe00d0519d24212f66b3817517eb82 /kernel/sched.c
parent31e879309474d1666d645b96de99d0b682fa055f (diff)
parent9c95e7319ba98585ebb6d304eca2d56f401ed70c (diff)
downloadlinux-stable-097cc62283455668ad0b35c72920c6373f45c2ab.tar.gz
linux-stable-097cc62283455668ad0b35c72920c6373f45c2ab.tar.bz2
linux-stable-097cc62283455668ad0b35c72920c6373f45c2ab.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched
* git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched: sched: fix invalid sched_class use sched: add /proc/sys/kernel/sched_compat_yield
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index deeb1f8e0c30..6107a0cd6325 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1682,6 +1682,11 @@ void fastcall wake_up_new_task(struct task_struct *p, unsigned long clone_flags)
p->prio = effective_prio(p);
+ if (rt_prio(p->prio))
+ p->sched_class = &rt_sched_class;
+ else
+ p->sched_class = &fair_sched_class;
+
if (!p->sched_class->task_new || !sysctl_sched_child_runs_first ||
(clone_flags & CLONE_VM) || task_cpu(p) != this_cpu ||
!current->se.on_rq) {
@@ -4550,10 +4555,7 @@ asmlinkage long sys_sched_yield(void)
struct rq *rq = this_rq_lock();
schedstat_inc(rq, yld_cnt);
- if (unlikely(rq->nr_running == 1))
- schedstat_inc(rq, yld_act_empty);
- else
- current->sched_class->yield_task(rq, current);
+ current->sched_class->yield_task(rq, current);
/*
* Since we are going to call schedule() anyway, there's