MINOR: task: split the counts of local and global tasks picked
authorWilly Tarreau <w@1wt.eu>
Thu, 25 Feb 2021 06:09:08 +0000 (07:09 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 25 Feb 2021 08:44:16 +0000 (09:44 +0100)
commite7923c1d22a5eb830f419ca0d76d2f7fa2ee9930
tree1123edd1e00896e7f523e29ba0b8172a3368b323
parentbaf22733453a63155341a0a3cd0af706efce0734
MINOR: task: split the counts of local and global tasks picked

In process_runnable_tasks() we're still calling __task_unlink_rq() to
pick a task, and this function tries to guess where to pick the task
from and which counter to update while the caller's context already
has everything. Worse, the number of local tasks is decremented then
recredited, doubling the operations. In order to avoid this we first
need to keep separate counters for local and global tasks that were
picked. This is what this patch does.
src/task.c