Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About v3.13.15, io_uring, and liburing #1317

Closed
j1elo opened this issue Jan 17, 2024 · 7 comments
Closed

About v3.13.15, io_uring, and liburing #1317

j1elo opened this issue Jan 17, 2024 · 7 comments
Labels

Comments

@j1elo
Copy link
Contributor

j1elo commented Jan 17, 2024

Just an idea

Hi @ibc , just passing by the release notes I saw the entry for 3.13.15 and have read the whole trail of issues/PRs about Linux 6 and io_uring, all the way down to #1282.

The whole plot across those items seems to be that build scripts in mediasoup are checking for Linux kernel version >= 6 before attempting to even enable io_uring.

My comment raises specifically from this one:

  • meson.build only compiles liburing subproject if current host has kernel >6. Why? Because liburing depends on io-uring which is only available in Linux kernel >= 6.

Here's where I got curious. io_uring has supposedly been available in the Linux kernel since at least version 5.1, with following iterations adding more features and improvements. I'd say 5.6 was the version that started to be more "complete".

Source: articles like this on LWN, or random comments of people who were seemingly using it on Linux 5.4

On the other hand, the liburing readme states that

liburing itself is not tied to any specific kernel release, and hence it's possible to use the newest liburing release even on older kernels (and vice versa). Newer features may only be available on more recent kernels, obviously.

and the Meson wrap for liburing does indeed contain compilation checks to conditionally enable or disable a couple features depending on the capabilities of the build machine (see liburing/meson.build)

So I'd just wanted to point out that maybe mediasoup can simplify a bit and just do without different builds for kernel 5 vs. 6, always enabling io_uring with whatever features get compiled by the build machine (which as you noted for Ubuntu 20.04 has up to Kernel 5.15.0).

I noted that io_uring got some very nice performance improvements with kernel 6, but then it seems to me that the mediasoup worker as of today could be always built with io_uring support on all supported Linux platforms (aka. kernel > 5.6 for sure), and on runtime on modern systems it would just have a bit better performance due to newer host kernel 6.

@j1elo j1elo added the feature label Jan 17, 2024
@nazar-pc
Copy link
Collaborator

This is a lot of additional burden to identify features and bugs. Checking kernel version is a simple and straightforward way to get what we need on modern kernels. If you need it on older kernels and don't want to install modern HWE kernel, you'll have to fork mediasoup and put in the effort of figuring out what works and what doesn't.

@j1elo
Copy link
Contributor Author

j1elo commented Jan 17, 2024

I'm fine with the current state of things, I was just commenting on the fact that "io-uring which is only available in Linux kernel >= 6" wasn't technically true.

But my comment was (maybe naively) assuming that all io_uring features used by the worker's source code would keep compiling fine as-is when building on kernel 5.15. If that would not be the case, then disregard it all.

@nazar-pc
Copy link
Collaborator

wasn't technically true

You're right, but that is where mediasoup decided to support it

@jmillan
Copy link
Member

jmillan commented Jan 17, 2024

I was experiencing some issues with kernel 5.10 using sendto(), which is basic to us, and worked out simply fine when upgrading to 6.0.

IMO going forward just with versions >=6.0 is a safe guard against other possible incompatibilities, but changing the check to >=5.15 would be seamless.

@j1elo, if you test it with 5.15 and confirm everything works we can decrease the supported kernel version.

@nazar-pc
Copy link
Collaborator

We only ship precompiled binaries for major kernel versions, so 5.15 would still be downloaded without ui_uring support unless we make logic there more complicated

@jmillan
Copy link
Member

jmillan commented Jan 17, 2024

Forget about my comment, as the provided linked indicated, the issue was also present in kernel version 5.15.49.

@j1elo
Copy link
Contributor Author

j1elo commented Jan 17, 2024

Forget about my comment, as the provided linked indicated, the issue was also present in kernel version 5.15.49.

Oh well then, I'm sorry to have missed that one. Seems that even in 5.15, the implementation in the kernel wasn't yet we'll finished, even though the documented release version was much earlier!

It then does very much seem like kernel 6.x was indeed where the io_uring feature started to work reliably.

@j1elo j1elo closed this as completed Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants