Restartable Sequences "RSEQ" Seeing Up To 16.7x Speedup With Newest Linux Patch

Written by Michael Larabel in Linux Kernel on 10 October 2024 at 06:09 AM EDT. 2 Comments
LINUX KERNEL
For those making use of Restartable Sequences (RSEQ) on Linux systems, there is an enticing performance optimization on the way.

RSEQ as a reminder is a low-level synchronization primitive for operating on per-CPU data in user-space. With work by Mathieu Desnoyers, there is an improvement around cache locality for RSEQ concurrency IDs for intermittent workloads. Desnoyers explained in the patch:
"commit 223baf9d17f25 ("sched: Fix performance regression introduced by mm_cid") introduced a per-mm/cpu current concurrency id (mm_cid), which keeps a reference to the concurrency id allocated for each CPU. This reference expires shortly after a 100ms delay.

These per-CPU references keep the per-mm-cid data cache-local in situations where threads are running at least once on each CPU within each 100ms window, thus keeping the per-cpu reference alive.

However, intermittent workloads behaving in bursts spaced by more than 100ms on each CPU exhibit bad cache locality and degraded performance compared to purely per-cpu data indexing, because concurrency IDs are allocated over various CPUs and cores, therefore losing cache locality of the associated data."

With the newest work to improve the per-MM-CID cache locality, there can be very nice speed-ups for intermittent workloads:

benchmark results


Those interested in this performance optimization work for Restartable Sequences can see this patch for all the details.
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