From: Willy Tarreau Date: Mon, 5 Feb 2018 16:40:21 +0000 (+0100) Subject: MINOR: fd: remove the unneeded last CAS when adding an fd to the list X-Git-Tag: v1.9-dev1~436 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a8263f86b7e697bf4e40df88c769312a69ff61a;p=thirdparty%2Fhaproxy.git MINOR: fd: remove the unneeded last CAS when adding an fd to the list This was a leftover from the initial code where two threads could fight for the list's tail. --- diff --git a/src/fd.c b/src/fd.c index 04ac3350a9..06fd690539 100644 --- 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();