Commit 4f20771c authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] small scheduler cleanup

From: Ingo Molnar <mingo@elte.hu>

From: Nick Piggin <piggin@cyberone.com.au> wrote:

It removes the last place where we mess with run_list open coded.
parent 3dc567d8
...@@ -2398,6 +2398,7 @@ asmlinkage long sys_sched_yield(void) ...@@ -2398,6 +2398,7 @@ asmlinkage long sys_sched_yield(void)
{ {
runqueue_t *rq = this_rq_lock(); runqueue_t *rq = this_rq_lock();
prio_array_t *array = current->array; prio_array_t *array = current->array;
prio_array_t *target = rq->expired;
/* /*
* We implement yielding by moving the task into the expired * We implement yielding by moving the task into the expired
...@@ -2406,13 +2407,12 @@ asmlinkage long sys_sched_yield(void) ...@@ -2406,13 +2407,12 @@ asmlinkage long sys_sched_yield(void)
* (special rule: RT tasks will just roundrobin in the active * (special rule: RT tasks will just roundrobin in the active
* array.) * array.)
*/ */
if (likely(!rt_task(current))) { if (unlikely(rt_task(current)))
dequeue_task(current, array); target = rq->active;
enqueue_task(current, rq->expired);
} else { dequeue_task(current, array);
list_del(&current->run_list); enqueue_task(current, target);
list_add_tail(&current->run_list, array->queue + current->prio);
}
/* /*
* Since we are going to call schedule() anyway, there's * Since we are going to call schedule() anyway, there's
* no need to preempt: * no need to preempt:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment