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.
