MEDIUM: muxes: mark idle conns tasklets with TASK_F_USR1
authorWilly Tarreau <w@1wt.eu>
Tue, 2 Mar 2021 15:51:09 +0000 (16:51 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 5 Mar 2021 07:30:08 +0000 (08:30 +0100)
commite388f2fbca40197590bd15dce0f4eb4d6cded20a
treefaef4f41c61885a88304b921407c0c9112ec2b07
parent6fa8bcdc785c29cd3a29c14d2038f38b5547eff0
MEDIUM: muxes: mark idle conns tasklets with TASK_F_USR1

The muxes are touching the idle_conns_lock all the time now because
they need to be careful that no other thread has stolen their tasklet's
context.

This patch changes this a little bit by setting the TASK_F_USR1 flag on
the tasklet before marking a connection idle, and removing it once it's
not idle anymore. Thanks to this we have the guarantee that a tasklet
without this flag cannot be present in an idle list and does not need
to go through this costly lock. This is especially true for front
connections.
src/mux_fcgi.c
src/mux_h1.c
src/mux_h2.c