Support us on Patreon to keep GamingOnLinux alive. This ensures all of our main content remains free for everyone. Just good, fresh content! Alternatively, you can donate through PayPal. You can also buy games using our partner links for GOG and Humble Store.
We do often include affiliate links to earn us some pennies. See more here.

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, Misc
23 Likes
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
The comments on this article are closed.
1 comment

Eike Sep 24, 2021
View PC info
  • Supporter Plus
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:

Reward Tiers: Patreon. Plain Donations: PayPal.

This ensures all of our main content remains totally free for everyone! Patreon supporters can also remove all adverts and sponsors! Supporting us helps bring 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!
The comments on this article are closed.