]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: fd cache: And the thread_mask with all_threads_mask.
authorOlivier Houchard <ohouchard@haproxy.com>
Fri, 17 Aug 2018 11:37:59 +0000 (13:37 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 17 Aug 2018 12:50:47 +0000 (14:50 +0200)
When we choose to insert a fd in either the global or the local fd update list,
and the thread_mask against all_threads_mask before checking if it's tid_bit,
that way, if we run with nbthreads==1, we will always use the local list,
which is cheaper than the global one.

include/proto/fd.h

index a4cee3220ef33aff29d9a1c81ae763c0d33e6a95..a3ec5e8544284781e8c621d856eb395cd85619c8 100644 (file)
@@ -109,7 +109,7 @@ 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 == tid_bit) {
+       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 */