From 22dad56815ce0201c5ae7d5ef5d79cc0c6a42c5e Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Mon, 27 Jun 2016 15:18:38 -0400 Subject: [PATCH] Lazily initialize max poll set size MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau --- src/bin/lttng-consumerd/lttng-consumerd.c | 6 ------ src/bin/lttng-relayd/main.c | 6 ------ src/bin/lttng-sessiond/main.c | 7 ------- src/common/compat/compat-epoll.c | 5 +++-- 4 files changed, 3 insertions(+), 21 deletions(-) diff --git a/src/bin/lttng-consumerd/lttng-consumerd.c b/src/bin/lttng-consumerd/lttng-consumerd.c index 00660fcd6..1cc1eb9ae 100644 --- a/src/bin/lttng-consumerd/lttng-consumerd.c +++ b/src/bin/lttng-consumerd/lttng-consumerd.c @@ -362,12 +362,6 @@ int main(int argc, char **argv) goto exit_health_consumerd_cleanup; } - /* Set up max poll set size */ - if (lttng_poll_set_max_size()) { - retval = -1; - goto exit_init_data; - } - if (*command_sock_path == '\0') { switch (opt_type) { case LTTNG_CONSUMER_KERNEL: diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c index 6ad656625..007f95131 100644 --- a/src/bin/lttng-relayd/main.c +++ b/src/bin/lttng-relayd/main.c @@ -2802,12 +2802,6 @@ int main(int argc, char **argv) /* Init relay command queue. */ cds_wfcq_init(&relay_conn_queue.head, &relay_conn_queue.tail); - /* Set up max poll set size */ - if (lttng_poll_set_max_size()) { - retval = -1; - goto exit_init_data; - } - /* Initialize communication library */ lttcomm_init(); lttcomm_inet_init(); diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index ee19ef840..0c97b1cb6 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -5662,12 +5662,6 @@ int main(int argc, char **argv) goto exit_ht_cleanup_pipe; } - /* Set up max poll set size */ - if (lttng_poll_set_max_size()) { - retval = -1; - goto exit_set_max_size; - } - /* Create thread to clean up RCU hash tables */ ret = pthread_create(&ht_cleanup_thread, NULL, thread_ht_cleanup, (void *) NULL); @@ -6246,7 +6240,6 @@ exit_init_data: retval = -1; } exit_ht_cleanup: -exit_set_max_size: utils_close_pipe(ht_cleanup_pipe); exit_ht_cleanup_pipe: diff --git a/src/common/compat/compat-epoll.c b/src/common/compat/compat-epoll.c index 6259fd389..9c2688d33 100644 --- a/src/common/compat/compat-epoll.c +++ b/src/common/compat/compat-epoll.c @@ -76,8 +76,9 @@ int compat_epoll_create(struct lttng_poll_event *events, int size, int flags) } if (!poll_max_size) { - ERR("poll_max_size not initialized yet"); - goto error; + if (lttng_poll_set_max_size()) { + goto error; + } } /* Don't bust the limit here */ -- 2.34.1