After attempting for some time now to get their futex2 work into the Linux Kernel, Collabora have cut it all down to focus on one part that has seen thorough testing to help Windows games on Linux with Steam Play Proton.
The work, funded by Valve, is to help Windows game compatibility when they're run through Wine and Steam Play Proton to ensure they actually work and perform well. The current implementations in the Linux Kernel aren't ideal and so they've tried rewriting them. Now they're focusing on adding one specific syscall with "futex_waitv()" so that they "can focus on this operation that already have a well defined use case and has been tested for months now".
Something to note is that this doesn't just benefit games run through compatibility layers, it will also help native games too but obviously with what Valve is doing with the Steam Deck and Proton the focus has been largely on that. In the patches developer André Almeida explained the use case for it as:
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.
If you're interested in the full details you can see the mailing list entry.
Quoting: lejimsterHas any of this Futex stuff ever made it upstream? It seems like every year there is some attempt, but it never makes its way into the Kernel.The kernel cadence is a new version every two months, so more often than that 😝
I can see their point that they want to get their use case sorted for their use case, particularly before December, and they don't want to be bogged down by the kitchen sink nice-to-have stuff that people want, but I hope the design of the changes that get made doesn't prevent the kitchen sink stuff in the future. We don't want to have to have a futex3.
Quoting: lejimsterHas any of this Futex stuff ever made it upstream? It seems like every year there is some attempt, but it never makes its way into the Kernel.
Yeah zero of them have been accepted so far, this one is very small and nonintrusive though so I'm holding my thumbs.
See more from me