commit | 4d882bd80089eac21d949bdb6d10a8700fea32c6 | [log] [tgz] |
---|---|---|
author | Willy Tarreau <w@1wt.eu> | Thu Apr 13 15:22:42 2023 +0200 |
committer | Willy Tarreau <w@1wt.eu> | Thu Apr 13 16:57:51 2023 +0200 |
tree | a9e213e0d8e5ca678acf2967c06d2dd7bfc0fe7a | |
parent | 97da942ba6392086d3165835564089cd71cb7b23 [diff] |
MINOR: fd: optimize fd_claim_tgid() for use in fd_insert() fd_claim_tgid() uses a CAS to set the desired TGID on the FD. It's only called from fd_insert() where in the vast majority of cases, the tgid and refcount are zero before the call. However the loop was optimized for the case where it was equal to the desired TGID, systematically causing one extra round in the loop there. Better start assuming a zero value.