Support us on Patreon to keep GamingOnLinux alive. This ensures all of our main content remains free for everyone with no article paywalls. Just good, fresh content! Alternatively, you can donate through PayPal, Liberapay or Buy us a Coffee. You can also buy games using our partner links for GOG and Humble Store.

It seems the ongoing saga of getting the futex2 work into the Linux Kernel, which is supposed to help Linux gaming and Steam Play Proton, has another attempt up. This is a continuation of the cut-down and more focused code that was submitted back in early August, as Collabora hope to finally get it accepted into the Kernel.

The key point is that this code is not just to help Windows games on Linux through Proton but to also help native games. While the code better matches behaviour found on Windows, anything that needs it can benefit. As developer André Almeida explains:

"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."

Since we last wrote about it, two new versions of it have been sent in so it's now on the third iteration with these changes and improvements:

Changes from v2:
v2: https://lore.kernel.org/lkml/20210904231159.13292-1-andrealmeid@collabora.com/
- Last version, I made compat and non-compat use the same code, but
failed to remove the compat entry point. This is fixed now.
- Add ARM support

Changes from v1:
v1: https://lore.kernel.org/lkml/20210805190405.59110-1-andrealmeid@collabora.com/
- Tons of code and comment improvements and fixes (thanks Thomas!)
- Changed the struct to have explicit padding (thanks Arnd!)
- Created a kernel/futex.h
- Splitted syscall table changes from the implementation
- Compat and non-compat entry point now uses the same code and same
struct
- Added test for timeout

You can see the patches on the Linux Kernel mailing list.

Article taken from GamingOnLinux.com.
Tags: Kernel, Meta, Upcoming
27 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
10 comments

sub 14 Sep
The first two attempts got rejected?
BielFPs 14 Sep
This is one of the reasons I think Steam Deck might ship with Valve's custom kernel, with Futex2 and probably some other out of tree patches.
Pikolo 14 Sep
Quoting: subThe first two attempts got rejected?
Rare is the patch series affecting system calls, new file systems, schedulers or otherwise performance related, that makes it into the Linux kernel on the first attempt. When it takes more then 7 revisions, then you should start to worry. Memory folios, an important rework of memory handling, are on their 14th iteration right now. (https://www.phoronix.com/scan.php?page=news_item&px=Folios-Pagesets-MIA-5.15) Folios only change internal APIs, while new system calls, as part of the kernel external API, will be maintained forever.


Last edited by Pikolo on 14 September 2021 at 12:37 pm UTC
Quoting: subThe first two attempts got rejected?
Yeah, there've been articles here about those. But you know, looking at the little "changes" bit there, I don't understand a word about what specifically they changed, but I get the impression that criticism by Serious Kernel Types was constructive and resulted in real improvements to the code, and also that the third version changed a lot less than the second version, which suggests that the heavy lifting of meeting requirements was done after the original patch was critiqued, while the third version was just taking care of a couple of loose ends.

That seems like real progress, not stonewalling, and seems like maybe either this third one will be accepted, or a couple of other loose ends might turn up but at any rate we're getting close.
TheRiddick 15 Sep
Been using this with xanmod kernel for a while. It mostly works but there are some games that don't like it and will refuse to launch. Mostly older 32bit games.
elmapul 16 Sep
"- Add ARM support"
wth '-', serious? there is any wine-arm?
elmapul 16 Sep
Quoting: BielFPsThis is one of the reasons I think Steam Deck might ship with Valve's custom kernel, with Futex2 and probably some other out of tree patches.

probably with some form of drm to convince netflix and others to support it (netflix already works on linux at 720p, but im not sure about disney+ and others)

and the deal they have with anti cheat solutions may include some kernel level features.
Eike 16 Sep
Quoting: elmapul"- Add ARM support"
wth '-', serious? there is any wine-arm?

I guess having something included is easier if it tastes less like "our special solution to run proprietary software, on amd64 only".
whizse 16 Sep
  • Supporter
Quoting: elmapul"- Add ARM support"
wth '-', serious? there is any wine-arm?
Wine is ported to Android and does (supposedly, I never tried it) run some WinRT applications on ARM.


Last edited by whizse on 16 September 2021 at 9:44 am UTC
elmapul 16 Sep
Quoting: whizse
Quoting: elmapul"- Add ARM support"
wth '-', serious? there is any wine-arm?
Wine is ported to Android and does (supposedly, I never tried it) run some WinRT applications on ARM.
applications is a thing that dont require an low input lag to work...
i wonder how well it can play games
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
None currently, submit yours here!