From 5c2dd3913aad5c4bf7d9056e1336025c2703586b Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Fri, 15 Jul 2016 15:18:57 +0300 Subject: Events: support for EPOLLEXCLUSIVE. This flag appeared in Linux 4.5 and is useful for avoiding thundering herd problem. The current Linux kernel implementation walks the list of exclusive waiters, and queues an event to each epfd, until it finds the first waiter that has threads blocked on it via epoll_wait(). --- auto/os/linux | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'auto/os') diff --git a/auto/os/linux b/auto/os/linux index 132ce3b42..fae8842c6 100644 --- a/auto/os/linux +++ b/auto/os/linux @@ -70,6 +70,22 @@ if [ $ngx_found = yes ]; then ee.data.ptr = NULL; epoll_ctl(efd, EPOLL_CTL_ADD, fd, &ee)" . auto/feature + + + # EPOLLEXCLUSIVE appeared in Linux 4.5, glibc 2.24 + + ngx_feature="EPOLLEXCLUSIVE" + ngx_feature_name="NGX_HAVE_EPOLLEXCLUSIVE" + ngx_feature_run=no + ngx_feature_incs="#include " + ngx_feature_path= + ngx_feature_libs= + ngx_feature_test="int efd = 0, fd = 0; + struct epoll_event ee; + ee.events = EPOLLIN|EPOLLEXCLUSIVE; + ee.data.ptr = NULL; + epoll_ctl(efd, EPOLL_CTL_ADD, fd, &ee)" + . auto/feature fi -- cgit