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)
{
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(&current->run_list);
list_add_tail(&current->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:
......
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