Restartable Sequences "RSEQ" Support Returning To GNU C Library

Written by Michael Larabel in GNU on 10 December 2021 at 06:04 AM EST. 4 Comments
Back in 2018 for the Linux 4.18 kernel was introducing the Restartable Sequences system call for allowing faster user-space operations on per-CPU data. By avoiding atomic operations in cases like incrementing per-CPU counters, modifying per-CPU spinlocks, reading/writing to per-CPU ring buffers, and similar, Restartable Sequences can provide a performance advantage. The GNU C Library is landing its revised support for making use of this system call.

Restartable Sequences has shown nice performance potential and generated interest among developers. Glibc has been working on utilizing Restartable Sequences and the initial code was merged in 2020. More background information on RSEQ can be learned at from their work over the years on this support.

The next Glibc release should have its Restartable Sequences interface for more easily making use of this system call. The GNU C Library is also now wired up to make use of RSEQ for its sched_getcpu call as one beneficiary.

While the RSEQ support was merged into Glibc, it was later dropped pre-release. The Restartable Sequences code was removed from Glibc over open design issues and the possibility of the kernel ABI not being finalized.

RSEQ has looked quite promising for per-CPU data performance improvements now after nearly four years by the time of Glibc 2.35 the fruits can be more easily enjoyed.

More than one year later, things have settled down and the GNU C Library appears ready to make use of this performance-helping system call. Following some prep patches merged earlier in the week, the initial RSEQ code was merged yesterday. This includes bits for RSEQ registration, a glibc.pthread.rseq tunable to control RSEQ registration so applications can register it instead of Glibc, the public RSEQ symbols and sys/rseq.h, and using RSEQ to accelerate sched_getcpu.

Assuming no reverts again, the Restartable Sequences support will be in Glibc 2.35 due out in February.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of 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 automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via

Popular News This Week