MEDIUM: ssl: implement xprt_set_used and xprt_set_idle to relax context checks
authorWilly Tarreau <w@1wt.eu>
Tue, 2 Mar 2021 16:29:56 +0000 (17:29 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 10 Mar 2021 14:11:16 +0000 (15:11 +0100)
commitb0d3a28469112be1b41d744c41355ea35e38b4dd
treec85591826b1803908d657036ffce7e2501f2f8f2
parent9a4864dc5bcec78820886ff6a0c078426fade9d6
MEDIUM: ssl: implement xprt_set_used and xprt_set_idle to relax context checks

Currently the SSL layer checks the validity of its tasklet's context just
in case it would have been stolen, had the connection been idle. Now it
will be able to be notified by the mux when this situation happens so as
not to have to grab the idle connection lock on each pass. This reuses the
TASK_F_USR1 flag just as the muxes do.

(cherry picked from commit 4149168255b1dc252aece0e5bbab6f55310f1ad5)
[wt: this is the second part of the takeover lock reduction, as the SSL
 layer was also hammering this lock and slowing everyone down, especially
 during initial handshakes. The changes are the same as for the muxes]
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/ssl_sock.c