]> err.no Git - linux-2.6/blobdiff - kernel/sched_rt.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6
[linux-2.6] / kernel / sched_rt.c
index 1edaa99e0d3d34fe6122323d96d7a03b4fd2c462..4b87476a02d0fec53239c896c8f2b210964b8f92 100644 (file)
@@ -36,8 +36,7 @@ static void enqueue_task_rt(struct rq *rq, struct task_struct *p, int wakeup)
 /*
  * Adding/removing a task to/from a priority array:
  */
-static void
-dequeue_task_rt(struct rq *rq, struct task_struct *p, int sleep, u64 now)
+static void dequeue_task_rt(struct rq *rq, struct task_struct *p, int sleep)
 {
        struct rt_prio_array *array = &rq->rt.active;
 
@@ -74,7 +73,7 @@ static void check_preempt_curr_rt(struct rq *rq, struct task_struct *p)
                resched_task(rq->curr);
 }
 
-static struct task_struct *pick_next_task_rt(struct rq *rq, u64 now)
+static struct task_struct *pick_next_task_rt(struct rq *rq)
 {
        struct rt_prio_array *array = &rq->rt.active;
        struct task_struct *next;
@@ -93,7 +92,7 @@ static struct task_struct *pick_next_task_rt(struct rq *rq, u64 now)
        return next;
 }
 
-static void put_prev_task_rt(struct rq *rq, struct task_struct *p, u64 now)
+static void put_prev_task_rt(struct rq *rq, struct task_struct *p)
 {
        update_curr_rt(rq);
        p->se.exec_start = 0;
@@ -208,10 +207,15 @@ static void task_tick_rt(struct rq *rq, struct task_struct *p)
                return;
 
        p->time_slice = static_prio_timeslice(p->static_prio);
-       set_tsk_need_resched(p);
 
-       /* put it at the end of the queue: */
-       requeue_task_rt(rq, p);
+       /*
+        * Requeue to the end of queue if we are not the only element
+        * on the queue:
+        */
+       if (p->run_list.prev != p->run_list.next) {
+               requeue_task_rt(rq, p);
+               set_tsk_need_resched(p);
+       }
 }
 
 static struct sched_class rt_sched_class __read_mostly = {