]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
sched: simplify sched_class::yield_task()
authorDmitry Adamushko <dmitry.adamushko@gmail.com>
Mon, 15 Oct 2007 15:00:08 +0000 (17:00 +0200)
committerIngo Molnar <mingo@elte.hu>
Mon, 15 Oct 2007 15:00:08 +0000 (17:00 +0200)
the 'p' (task_struct) parameter in the sched_class :: yield_task() is
redundant as the caller is always the 'current'. Get rid of it.

   text    data     bss     dec     hex filename
  24341    2734      20   27095    69d7 sched.o.before
  24330    2734      20   27084    69cc sched.o.after

Signed-off-by: Dmitry Adamushko <dmitry.adamushko@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
include/linux/sched.h
kernel/sched.c
kernel/sched_fair.c
kernel/sched_rt.c

index f776a30b403e7d5ceb15c05352a2ab36b7d7c01e..66169005f008c2c5c50b0891671bed2c7f9135f7 100644 (file)
@@ -858,7 +858,7 @@ struct sched_class {
 
        void (*enqueue_task) (struct rq *rq, struct task_struct *p, int wakeup);
        void (*dequeue_task) (struct rq *rq, struct task_struct *p, int sleep);
-       void (*yield_task) (struct rq *rq, struct task_struct *p);
+       void (*yield_task) (struct rq *rq);
 
        void (*check_preempt_curr) (struct rq *rq, struct task_struct *p);
 
index 3b104635a8eafb4b9ef6664e8898606595405010..e1f784f4b4db07abfddda83364cff801e77cac2b 100644 (file)
@@ -4537,7 +4537,7 @@ asmlinkage long sys_sched_yield(void)
        struct rq *rq = this_rq_lock();
 
        schedstat_inc(rq, yld_cnt);
-       current->sched_class->yield_task(rq, current);
+       current->sched_class->yield_task(rq);
 
        /*
         * Since we are going to call schedule() anyway, there's
index 827a0636525a36e35ead96313235a54ba143021e..4dd256d4685308fb0caa37d2753cb65d1513eca0 100644 (file)
@@ -722,11 +722,11 @@ static void dequeue_task_fair(struct rq *rq, struct task_struct *p, int sleep)
  *
  * If compat_yield is turned on then we requeue to the end of the tree.
  */
-static void yield_task_fair(struct rq *rq, struct task_struct *p)
+static void yield_task_fair(struct rq *rq)
 {
-       struct cfs_rq *cfs_rq = task_cfs_rq(p);
+       struct cfs_rq *cfs_rq = &rq->cfs;
        struct rb_node **link = &cfs_rq->tasks_timeline.rb_node;
-       struct sched_entity *rightmost, *se = &p->se;
+       struct sched_entity *rightmost, *se = &rq->curr->se;
        struct rb_node *parent;
 
        /*
@@ -741,8 +741,8 @@ static void yield_task_fair(struct rq *rq, struct task_struct *p)
                 * Dequeue and enqueue the task to update its
                 * position within the tree:
                 */
-               dequeue_entity(cfs_rq, &p->se, 0);
-               enqueue_entity(cfs_rq, &p->se, 0);
+               dequeue_entity(cfs_rq, se, 0);
+               enqueue_entity(cfs_rq, se, 0);
 
                return;
        }
index 45b339f56aea2f12262ac3446e87eb525c32cc03..b86944c20f9f490c5db1b9db72a60d1e6fe8908d 100644 (file)
@@ -59,9 +59,9 @@ static void requeue_task_rt(struct rq *rq, struct task_struct *p)
 }
 
 static void
-yield_task_rt(struct rq *rq, struct task_struct *p)
+yield_task_rt(struct rq *rq)
 {
-       requeue_task_rt(rq, p);
+       requeue_task_rt(rq, rq->curr);
 }
 
 /*