From 4f20771c44e8c2e5ce6ca0b62293f71397230b8f Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sun, 9 May 2004 23:23:31 -0700 Subject: [PATCH] [PATCH] small scheduler cleanup From: Ingo Molnar From: Nick Piggin wrote: It removes the last place where we mess with run_list open coded. --- kernel/sched.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/kernel/sched.c b/kernel/sched.c index 1493acff560f9..a4f2c009975aa 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -2398,6 +2398,7 @@ asmlinkage long sys_sched_yield(void) { runqueue_t *rq = this_rq_lock(); prio_array_t *array = current->array; + prio_array_t *target = rq->expired; /* * We implement yielding by moving the task into the expired @@ -2406,13 +2407,12 @@ asmlinkage long sys_sched_yield(void) * (special rule: RT tasks will just roundrobin in the active * array.) */ - if (likely(!rt_task(current))) { - dequeue_task(current, array); - enqueue_task(current, rq->expired); - } else { - list_del(¤t->run_list); - list_add_tail(¤t->run_list, array->queue + current->prio); - } + if (unlikely(rt_task(current))) + target = rq->active; + + dequeue_task(current, array); + enqueue_task(current, target); + /* * Since we are going to call schedule() anyway, there's * no need to preempt: -- 2.53.0