]> git.ipfire.org Git - thirdparty/haproxy.git/commit
OPTIM: tasks: group all tree roots per cache line
authorWilly Tarreau <w@1wt.eu>
Mon, 15 Oct 2018 14:12:48 +0000 (16:12 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 15 Oct 2018 17:06:13 +0000 (19:06 +0200)
commit8d8747abe09bb81c3c83b7eab96020c2585c8022
tree3cd62d6aaf78290d197131f0283096cee9dcc647
parentb20aa9eef354b5cca3f9ea43aab38d568e7fdeb7
OPTIM: tasks: group all tree roots per cache line

Currently we have per-thread arrays of trees and counts, but these
ones unfortunately share cache lines and are accessed very often. This
patch moves the task-specific stuff into a structure taking a multiple
of a cache line, and has one such per thread. Just doing this has
reduced the cache miss ratio from 19.2% to 18.7% and increased the
12-thread test performance by 3%.

It starts to become visible that we really need a process-wide per-thread
storage area that would cover more than just these parts of the tasks.
The code was arranged so that it's easy to move the pieces elsewhere if
needed.
include/proto/task.h
src/task.c