From: Olivier Houchard Date: Fri, 17 Aug 2018 11:37:59 +0000 (+0200) Subject: MINOR: fd cache: And the thread_mask with all_threads_mask. X-Git-Tag: v1.9-dev2~146 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6aab7378354ad704fed1e14fff256e2d74f60090;p=thirdparty%2Fhaproxy.git MINOR: fd cache: And the thread_mask with all_threads_mask. 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. --- diff --git a/include/proto/fd.h b/include/proto/fd.h index a4cee3220e..a3ec5e8544 100644 --- a/include/proto/fd.h +++ b/include/proto/fd.h @@ -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 */