FUTEX2 Linux Patches Updated To Support Variable-Sized Futexes

Written by Michael Larabel in Valve on 3 June 2021 at 05:46 PM EDT. 102 Comments
VALVE
One of the elusive kernel patch series we have been eager to see for the mainline Linux kernel has just been spun up a fourth time.

Going back over a year has been the proposed FUTEX2 system call to extend FUTEX, which for a year prior to to going for a new/separate system call had been aiming to optimize FUTEX for enhancing the Linux gaming experience by better matching the behavior of Windows -- in particular, around Windows NT allowing to wait on multiple objects.

FUTEX2 allows for waiting on any of several futexes and to better support other features moving forward instead of trying to fit them into the existing futex system call without breaking the interface. Among the possibilities are variable bit size futexes and NUMA optimizations.

The FUTEX2 system call has been tested with a patched version of Wine/Proton and also a modified version of the GNU C Library. The FUTEX2 kernel support paired with the patched user-space around Wine should help with efficiency gains and further enhancing the performance of running Windows games on Linux.

Sent out today were the v4 patches for the FUTEX2 system call support. With version four, the previously talked about variable sized futexes should now be fully supported. That is support for 8, 16, 32, and 64-bit futexes to complement the existing 32-bit support and better supporting the atomic primitive needs of user-space.

Perhaps now that the variable sized futexes support is ironed out, maybe we'll see this work move closer to being mainlined... The next opportunity will be with 5.14 but given that the v4 patches were just posted, there isn't any further feedback yet or insight into the prospects for finally making it in the next kernel release.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week