How Linux’s New getrandom() Overhaul Boosts Performance by Up to 8450%
Under Jason Donenfeld’s leadership, Linux kernel random number generation was dramatically revamped in versions 5.17 and 5.18, replacing SHA1 with BLAKE2s and shifting from per‑NUMA to per‑CPU structures, delivering up to 131% speed gains in 5.17 and a staggering 8450% boost for getrandom() on multi‑core systems.
Jason Donenfeld, the primary developer of WireGuard and maintainer of Linux kernel random-number code, led a major overhaul of the kernel’s random number generator in recent releases.
In Linux 5.17, the random code switched from SHA‑1 to BLAKE2s, a faster and more secure hash. Benchmarks showed roughly a 131 % speed increase with this simple change.
Continuing the effort, Linux 5.18 introduced further redesigns. The global per‑NUMA data structure was replaced by a per‑CPU structure, eliminating many locks on the fast path. This change also removed the need to defer work to a workqueue.
Stress‑ng tests of the getrandom() syscall on a system equipped with an Intel Xeon E5‑2697 v2 (2.70 GHz) and 112 GB RAM demonstrated an astonishing 8450 % performance gain compared with the previous implementation.
Commit logs from the random.git repository show a flurry of contributions by Donenfeld over a two‑day period, all slated for inclusion during the Linux 5.18 merge window in late March.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
