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

Enable/Disable Futex support for io_uring #5628

Open
mrVrAlex opened this issue Dec 18, 2024 · 4 comments
Open

Enable/Disable Futex support for io_uring #5628

mrVrAlex opened this issue Dec 18, 2024 · 4 comments

Comments

@mrVrAlex
Copy link

For now during build swoole from source code configure script check linux kernel version (>6.7) and enable futex support automatically. But what happen if build happened for example on kernel v6.8 (or just in docker container with latest kernel), but docker container will be run on host machine with kernel v6.6? io_uring will not works?
It will be common situation in real world, LTS linux release - v6.6 and another LTS v6.12 only recently appear - all cloud & hosters, etc do not have fresh linux kernel...
For now can possible not using io_uring (do not include --enable-iouring) but no --enable-futex or --disable-futex configure options...

@NathanFreeman
Copy link
Member

The enabling or disabling of the iouring futex feature is determined by the output of uname -r. You need to execute uname -r in the Docker container to see if the output reflects the host's kernel information or the Docker image's kernel information.

@cjavad
Copy link
Contributor

cjavad commented Dec 19, 2024

Alternatively using io_uring_opcode_supported will provide more accurate information with the probe feature of liburing. e.i. io_uring_opcode_supported(probe, IORING_OP_FUTEX_WAIT)

@mrVrAlex
Copy link
Author

It is not a answer.
If I build swoole on linux kernel 6.8 with --enable-iouring for example on base alpine:3.21 docker image - then during build futex feature will be enabled.
BUT if I will run container with it docker image on host machine with OLD linux kernel like 6.1 - what exactly will happen with file IO operations?

@NathanFreeman
Copy link
Member

For file operations, it doesn't have much impact; the main purpose of the iouring futex feature is to support coroutine locks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants