]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: fd: remove the unneeded last CAS when adding an fd to the list
authorWilly Tarreau <w@1wt.eu>
Mon, 5 Feb 2018 16:40:21 +0000 (17:40 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 5 Feb 2018 18:45:39 +0000 (19:45 +0100)
This was a leftover from the initial code where two threads could fight
for the list's tail.

src/fd.c

index 04ac3350a9cf4c98b7e376fa835b386c4ed03bf6..06fd690539c1a28572da0e91330a698a4ce869ac 100644 (file)
--- a/src/fd.c
+++ b/src/fd.c
@@ -233,12 +233,7 @@ redo_last:
                } while (1);
        }
        /* Then, update the last entry */
-redo_fd_cache:
-       last = list->last;
-       __ha_barrier_load();
-
-       if (unlikely(!HA_ATOMIC_CAS(&list->last, &last, fd)))
-               goto redo_fd_cache;
+       list->last = fd;
        __ha_barrier_store();
        fdtab[fd].cache.next = -1;
        __ha_barrier_store();