From 8a880a84dcb8ee64cbc4a5e04cae6775b4f9babd Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Wed, 6 Apr 2022 15:32:44 -0400 Subject: [PATCH] Bump minimum kernel version to 2.6.30 to use EFD_SEMAPHORE MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The bump in the kernel version allows the use of EFD_SEMAPHORE for eventfd. Adjust the README.md to reflect this. No need to provide direct instruction for older kernel. We leave the '--disable-epoll' switch available and the code behind it simply because other platform might not have epoll available. Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau Change-Id: Id512f018c5394c9cc699e19c3d5a0d753e56414b --- README.adoc | 9 +-------- .../lttng-sessiond/notification-thread-events.cpp | 12 ------------ src/bin/lttng-sessiond/notification-thread.cpp | 2 +- 3 files changed, 2 insertions(+), 21 deletions(-) diff --git a/README.adoc b/README.adoc index b9669d941..830dd933e 100644 --- a/README.adoc +++ b/README.adoc @@ -52,11 +52,7 @@ endif::env-github[] You need the following dependencies to build and run the {lt} components: -* **Linux kernel{nbsp}≥{nbsp}2.6.27** -+ -Use `{nbh}{nbh}disable{nbh}epoll` at <> -time to build {lt} for an older kernel. However, note that we can't -provide any guarantee below 2.6.27. +* **Linux kernel{nbsp}≥{nbsp}2.6.30** * **http://www.liburcu.org/[Userspace{nbsp}RCU]{nbsp}≥{nbsp}0.11.0**. + @@ -193,9 +189,6 @@ If you want to embed the manual pages into the `lttng`, so that you don't need `man` to view them, use the `{nbh}{nbh}enable{nbh}embedded{nbh}help` option. -If your Linux kernel is older than 2.6.27, use the -`{nbh}{nbh}disable{nbh}epoll` option. - This build configuration script finds LTTng{nbh}UST with https://www.freedesktop.org/wiki/Software/pkg-config/[pkg{nbh}config]: set the `PKG_CONFIG_PATH` environment variable accordingly if diff --git a/src/bin/lttng-sessiond/notification-thread-events.cpp b/src/bin/lttng-sessiond/notification-thread-events.cpp index da4f8a4b2..909ccbff2 100644 --- a/src/bin/lttng-sessiond/notification-thread-events.cpp +++ b/src/bin/lttng-sessiond/notification-thread-events.cpp @@ -3137,18 +3137,6 @@ int pop_cmd_queue(struct notification_thread_handle *handle, goto error_unlock; } - /* Simulate behaviour of EFD_SEMAPHORE for older kernels. */ - counter -= 1; - if (counter != 0) { - ret = lttng_write(handle->cmd_queue.event_fd, &counter, - sizeof(counter)); - if (ret != sizeof(counter)) { - PERROR("Failed to write back to event_fd for EFD_SEMAPHORE emulation"); - ret = -1; - goto error_unlock; - } - } - *cmd = cds_list_first_entry(&handle->cmd_queue.list, struct notification_thread_command, cmd_list_node); cds_list_del(&((*cmd)->cmd_list_node)); diff --git a/src/bin/lttng-sessiond/notification-thread.cpp b/src/bin/lttng-sessiond/notification-thread.cpp index 17a995682..7d9f4ed12 100644 --- a/src/bin/lttng-sessiond/notification-thread.cpp +++ b/src/bin/lttng-sessiond/notification-thread.cpp @@ -105,7 +105,7 @@ struct notification_thread_handle *notification_thread_handle_create( sem_init(&handle->ready, 0, 0); - event_fd = eventfd(0, EFD_CLOEXEC); + event_fd = eventfd(0, EFD_CLOEXEC | EFD_SEMAPHORE); if (event_fd < 0) { PERROR("event_fd creation"); goto error; -- 2.34.1