How Linux’s Random Number Generator Got a 8450% Speed Boost in 5.18

Under Jason Donenfeld’s leadership, Linux kernel’s random number generator was overhauled in versions 5.17 and 5.18, replacing SHA1 with BLAKE2s and shifting from per‑NUMA to per‑CPU structures, delivering up to a 131% speed increase and an astonishing 8450% boost in getrandom() performance on multi‑core systems.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
How Linux’s Random Number Generator Got a 8450% Speed Boost in 5.18

Jason Donenfeld, the lead developer of WireGuard and maintainer of the Linux kernel’s random number generator, has recently overseen major improvements to the kernel’s entropy subsystem.

In Linux 5.17 the random code was updated to use BLAKE2s instead of SHA‑1; because BLAKE2s is faster and more secure, this simple change yielded roughly a 131 % speed increase.

Continuing the work in Linux 5.18, Donenfeld refactored the generator’s data structures from a global per‑NUMA layout to a per‑CPU layout, removing many locks on the fast path and eliminating the need to defer work to a queue.

The commit log for the random.git repository shows a flurry of contributions over two days that will be merged during the March 5.18 merge window.

An email from the developer highlighted that the new code improves the getrandom() system call. Benchmarks on an Intel Xeon E5‑2697 v2 (2.70 GHz, 112 GB RAM) using stress‑ng getrandom() demonstrated an astonishing 8450 % performance gain.

By switching to a per‑CPU structure, many locks disappear on multi‑core CPUs, which explains the dramatic speedup; the change also removes the previous requirement to defer operations to a work queue, further benefiting high‑core‑count machines and servers.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

performanceKernelLinuxSecurityrandomBLAKE2s
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.