]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: task: Also consider the task list size when getting global tasks.
authorOlivier Houchard <ohouchard@haproxy.com>
Mon, 28 May 2018 12:53:08 +0000 (14:53 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 28 May 2018 13:20:59 +0000 (15:20 +0200)
We're taking tasks from the global runqueue based on the number of tasks
the thread already have in its local runqueue, but now that we have a task
list, we also have to take that into account.

src/task.c

index 25ffe21db289d7670595feceacccf3bfa984bcf3..fb48407387b5c6b83bfb6035744534b161ef6788 100644 (file)
@@ -260,7 +260,7 @@ void process_runnable_tasks()
                 * much elements from the global list as to have a bigger local queue
                 * than the average.
                 */
-               while (rqueue_size[tid] <= average) {
+               while ((task_list_size[tid] + rqueue_size[tid]) <= average) {
 
                        /* we have to restart looking up after every batch */
                        rq_next = eb32sc_lookup_ge(&rqueue, rqueue_ticks - TIMER_LOOK_BACK, tid_bit);