From 3a8263f86b7e697bf4e40df88c769312a69ff61a Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 5 Feb 2018 17:40:21 +0100 Subject: [PATCH] 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. --- src/fd.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) 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(); -- 2.47.3