]> git.ipfire.org Git - thirdparty/haproxy.git/commit
OPTIM: vars: only takes the variables lock on shared entries
authorWilly Tarreau <w@1wt.eu>
Wed, 8 Sep 2021 13:20:45 +0000 (15:20 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 8 Sep 2021 13:44:45 +0000 (15:44 +0200)
commit61ecf2838991a659127e90c00f8302e430e5076b
tree78504370177a37c5dc738e016ab16d4b82b6dc67
parentdc72fbb8e8cb895572c51389e1f8882be0fa89af
OPTIM: vars: only takes the variables lock on shared entries

There's no point taking the variables locks for sess/txn/req/res
contexts since these ones always run inside the same thread anyway.
This patch conditions the lock on the variable's scope to avoid
flushing cache lines when not needed.

This showed an improvement of ~5% on a 16-thread machine with 12
variables.
include/haproxy/vars.h