From: Olivier Houchard Date: Wed, 12 Jun 2019 12:31:08 +0000 (+0200) Subject: MINOR: fd: Don't use atomic operations when it's not needed. X-Git-Tag: v2.0.0~63 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0fdce3950bc499478a747300c0d8929df5360a4;p=thirdparty%2Fhaproxy.git MINOR: fd: Don't use atomic operations when it's not needed. In updt_fd_polling(), when updating fd_nbupdt, there's no need to use an atomic operation, as it's a TLS variable. --- diff --git a/include/proto/fd.h b/include/proto/fd.h index 745c4fe458..2efd1d3615 100644 --- a/include/proto/fd.h +++ b/include/proto/fd.h @@ -117,15 +117,13 @@ void fd_rm_from_fd_list(volatile struct fdlist *list, int fd, int off); static inline void updt_fd_polling(const int fd) { if ((fdtab[fd].thread_mask & all_threads_mask) == tid_bit) { - unsigned int oldupdt; /* note: we don't have a test-and-set yet in hathreads */ if (HA_ATOMIC_BTS(&fdtab[fd].update_mask, tid)) return; - oldupdt = _HA_ATOMIC_ADD(&fd_nbupdt, 1) - 1; - fd_updt[oldupdt] = fd; + fd_updt[fd_nbupdt++] = fd; } else { unsigned long update_mask = fdtab[fd].update_mask; do {