]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: epoll: move epoll_fd to read_mostly
authorWilly Tarreau <w@1wt.eu>
Sat, 10 Apr 2021 15:06:40 +0000 (17:06 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 10 Apr 2021 17:27:41 +0000 (19:27 +0200)
This one only contains the list of per-thread epoll FDs, and is used
a lot during updates. Let's mark it read_mostly to avoid false sharing
of FDs placed at the extremities.

src/ev_epoll.c

index 506805f891aecbe808e441b02192a1d98cab6aed..330c38c4495f1f3559a50bf8a52812220e26b921 100644 (file)
@@ -26,7 +26,7 @@
 
 /* private data */
 static THREAD_LOCAL struct epoll_event *epoll_events = NULL;
-static int epoll_fd[MAX_THREADS]; // per-thread epoll_fd
+static int epoll_fd[MAX_THREADS] __read_mostly; // per-thread epoll_fd
 
 #ifndef EPOLLRDHUP
 /* EPOLLRDHUP was defined late in libc, and it appeared in kernel 2.6.17 */