]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: task: move the allocated tasks counter to the per-thread struct
authorWilly Tarreau <w@1wt.eu>
Wed, 24 Feb 2021 16:03:30 +0000 (17:03 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 24 Feb 2021 16:42:04 +0000 (17:42 +0100)
commit955a11ebfaa1546e67dc21f8751208b2f67d086c
tree41695e283e18fe1e9ed75f6429910fe0615448bd
parenteeffb3df415d8f658e139f9a78adaf9d08212617
MINOR: task: move the allocated tasks counter to the per-thread struct

The nb_tasks counter was still global and gets incremented and decremented
for each task_new()/task_free(), and was read in process_runnable_tasks().
But it's only used for stats reporting, so doing this this often is
pointless and expensive. Let's move it to the task_per_thread struct and
have the stats sum it when needed.
include/haproxy/task-t.h
include/haproxy/task.h
src/stats.c
src/task.c