Join us on our own very special Reddit: /r/Linuxers

Another day, another try and getting the long-awaited futex2 patches into the Linux Kernel with another version submitted.

For a quick reminder: this work from Collabora is designed to help Linux gaming for both native games and Windows games run through Wine and the Steam Play Proton compatibility layers. This work was cut-down to size in the hopes of getting the simpler work actually upstreamed into the Linux Kernel. The idea is to basically better match Windows behaviour to improve compatibility, as the developer notes:

The use case of this syscall is to allow low level locking libraries to wait for multiple locks at the same time. This is specially useful for emulating Windows' WaitForMultipleObjects. A futex_waitv()-based solution has been used for some time at Proton's Wine (a compatibility layer to run Windows games on Linux). Compared to a solution that uses eventfd(), futex was able to reduce CPU utilization for games, and even increase frames per second for some games. This happens because eventfd doesn't scale very well for a huge number of read, write and poll calls compared to futex. Native game engines will benefit of this as well, given that this wait pattern is common for games.

This is what has changed in the new version:

- Added a clockid argument in sys_futex_waitv()
    - This required some changes in the timeout init
- Added test for wouldblock
- Added documentation file
- Fixed error path order for futex_wait_multiple()
- Return error if FUTEX_32 is not set for a waiter
    - Extended futex_waitv() selftest to cover error paths like this

Coming as a result of feedback received at the recent Linux Plumbers Conference 2021 where Collabora developer André Almeida gave an overview of what it is and why it's needed:

YouTube Thumbnail
YouTube videos require cookies, you must accept their cookies to view. View cookie preferences.
Accept Cookies & Show   Direct Link
Article taken from GamingOnLinux.com.
Tags: Kernel, Meta
23 Likes
We do often include affiliate links to earn us some pennies. We are currently affiliated with GOG and Humble Store. See more here.
About the author -
author picture
I am the owner of GamingOnLinux. After discovering Linux back in the days of Mandrake in 2003, I constantly came back to check on the progress of Linux until Ubuntu appeared on the scene and it helped me to really love it. You can reach me easily by emailing GamingOnLinux directly.
See more from me
1 comment

Eike 24 Sep
I'm not following it closely, but I get the impression of maturing code that will be included sooner or later (sounds like sooner to me).
While you're here, please consider supporting GamingOnLinux on:

Patreon, Liberapay or PayPal Donation.

This ensures all of our main content remains totally free for everyone with no article paywalls. We also don't have tons of adverts, there's also no tracking and we respect your privacy. Just good, fresh content. Without your continued support, we simply could not continue!

You can find even more ways to support us on this dedicated page any time. If you already are, thank you!
Login / Register

Or login with...
Sign in with Steam Sign in with Twitter Sign in with Google
Social logins require cookies to stay logged in.

Livestreams & Videos
Community Livestreams