Commit b5734da1 authored by Ingo Molnar's avatar Ingo Molnar

- wait_task_inactive() preemption-latency optimization: we should

  enable/disable preemption to not spend too much time with
  preemption disabled. wait_task_inactive() can take quite some
  time occasionally ...
parent 16fea1db
...@@ -303,9 +303,15 @@ void wait_task_inactive(task_t * p) ...@@ -303,9 +303,15 @@ void wait_task_inactive(task_t * p)
repeat: repeat:
preempt_disable(); preempt_disable();
rq = task_rq(p); rq = task_rq(p);
while (unlikely(rq->curr == p)) { if (unlikely(rq->curr == p)) {
cpu_relax(); cpu_relax();
barrier(); /*
* enable/disable preemption just to make this
* a preemption point - we are busy-waiting
* anyway.
*/
preempt_enable();
goto repeat;
} }
rq = task_rq_lock(p, &flags); rq = task_rq_lock(p, &flags);
if (unlikely(rq->curr == p)) { if (unlikely(rq->curr == p)) {
......
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