Commit df6e3433 authored by Linus Torvalds's avatar Linus Torvalds

Scheduler preempt fixes and cleanups

parent 326e5830
......@@ -782,9 +782,7 @@ asmlinkage void schedule(void)
case TASK_RUNNING:
;
}
#if CONFIG_SMP || CONFIG_PREEMPT
pick_next_task:
#endif
if (unlikely(!rq->nr_running)) {
#if CONFIG_SMP
load_balance(rq, 1);
......@@ -848,12 +846,14 @@ asmlinkage void schedule(void)
*/
asmlinkage void preempt_schedule(void)
{
if (unlikely(preempt_get_count()))
struct thread_info *ti = current_thread_info();
if (unlikely(ti->preempt_count))
return;
current_thread_info()->preempt_count += PREEMPT_ACTIVE;
ti->preempt_count = PREEMPT_ACTIVE;
schedule();
current_thread_info()->preempt_count -= PREEMPT_ACTIVE;
ti->preempt_count = 0;
barrier();
}
#endif /* CONFIG_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