VOOZH about

URL: https://www.phoronix.com/news/Linux-6.19-Optimize-RSEQ-Exit

⇱ Linux 6.19 To Optimize Exiting To User-Space For Restartable Sequences - Phoronix


👁 Phoronix

Linux 6.19 To Optimize Exiting To User-Space For Restartable Sequences

Written by Michael Larabel in Linux Kernel on 3 November 2025 at 05:45 PM EST. 1 Comment
Queued up in a TIP branch ahead of the Linux 6.19 merge window opening in about one month's time is optimizing the Restartable Sequences "RSEQ" code for its exit to user-space code path.

Intel Fellow Thomas Gleixner of Linutronix worked on a set of patches recently for optimizing the exit to user-space path for Restartable Sequences, the functionality for efficient access and manipulation of per-CPU data structures by user-space.

Gleixner explained in the mailing list patch series:
"TLDR:
- A significant amount of pointless RSEQ operations on exit to user space, which have been reported by people as measurable impact after glibc switched to use RSEQ

- Suboptimal hotpath handling both in the scheduler and on exit to user space.

This series addresses these issues by:

1) Limiting the RSEQ work to the actual conditions where it is required. The full benefit is only available for architectures using the generic entry infrastructure. All others get at least the basic improvements.

2) Re-implementing the whole user space handling based on proper data structures and by actually looking at the impact it creates in the fast path.

3) Moving the actual handling of RSEQ out to the latest point in the exit path, where possible. This is fully inlined into the fast path to keep the impact confined."

The RSEQ usage by the GNU C Library has been present since Glibc 2.41 earlier this year after the earlier Glibc RSEQ implementation needed a rework years ago.

These optimization patches were queued up today in tip/tip.git's core/rseq branch. With the patches now in a TIP branch, they should be submitted for the upcoming Linux 6.19 merge window.

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.