]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: fd: refine the fd_takeover() migration lock
authorWilly Tarreau <w@1wt.eu>
Thu, 18 Jun 2020 05:28:09 +0000 (07:28 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 18 Jun 2020 05:28:09 +0000 (07:28 +0200)
commitc460c91633d5407a02f9d3aadf0abece5a4e4b45
tree23e25f13a742618a0611a7fa98be8a5b99e4194d
parent7af4fa9a4891bcd55ebccb2e97105f811c6851c8
MEDIUM: fd: refine the fd_takeover() migration lock

When haproxy is compiled without double-word CAS, we use a migration lock
in fd_takeover(). This lock was covering the atomic OR on the running_mask
before checking its value, while it is not needed since this atomic op
already returns the result. Let's just refine the code to avoid grabbing
the lock in the event another thread has already stolen the FD, this may
reduce contention in high reuse rate scenarios.
src/fd.c