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.
This commit is contained in:
Willy Tarreau 2018-02-05 17:40:21 +01:00
parent abeaff2d54
commit 3a8263f86b

View File

@ -233,12 +233,7 @@ void fd_add_to_fd_list(volatile struct fdlist *list, int fd)
} while (1); } while (1);
} }
/* Then, update the last entry */ /* Then, update the last entry */
redo_fd_cache: list->last = fd;
last = list->last;
__ha_barrier_load();
if (unlikely(!HA_ATOMIC_CAS(&list->last, &last, fd)))
goto redo_fd_cache;
__ha_barrier_store(); __ha_barrier_store();
fdtab[fd].cache.next = -1; fdtab[fd].cache.next = -1;
__ha_barrier_store(); __ha_barrier_store();