Skip to content

Commit

Permalink
Bump minimum kernel version to 2.6.30 to use EFD_SEMAPHORE
Browse files Browse the repository at this point in the history
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 <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Id512f018c5394c9cc699e19c3d5a0d753e56414b
  • Loading branch information
PSRCode authored and jgalar committed Apr 12, 2022
1 parent f370852 commit 8a880a8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 21 deletions.
9 changes: 1 addition & 8 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<configure,build configuration>>
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**.
+
Expand Down Expand Up @@ -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
Expand Down
12 changes: 0 additions & 12 deletions src/bin/lttng-sessiond/notification-thread-events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion src/bin/lttng-sessiond/notification-thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8a880a8

Please sign in to comment.