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