mirror of
https://github.com/haproxy/haproxy.git
synced 2026-06-13 02:40:07 -04:00
Now that there is no longer a shared wake queue, chances are if a shared task is scheduled, it will always end up on the same thread. In wake_expired_tasks(), when a task has to be waken up, randomly look to three other threads, and if the runqueue of the current thread is at least two time bigger than the runqueue of one of the other threads, then give that task to that thread, so that our load gets reduced. If we're giving the task to another thread, then we have to add the TASK_RUNNING flag until we waked it up, otherwise the other thread could just run it, if it gets waken up from another path, and free it while we're still not done with it. 2 times has been chosen somewhat arbitrarily, and may be tweaked at a later date if deemed not optimal. |
||
|---|---|---|
| .. | ||
| haproxy | ||
| import | ||
| make | ||