NewsOpen SourceSecurityPerformance

Linux 7.2-rc4: MongoDB Gets 30–100% Faster, and strncpy Is Finally Dead

Linus Torvalds released Linux Kernel 7.2-rc4 on July 19 with the codebase now past 43 million lines, describing the pace as the “new normal.” Three changes in this release cycle are worth your time: MGLRU improvements that push MongoDB throughput up 30 to 100 percent without touching a single config file, a scheduler rewrite that finally makes the kernel topology-aware at the LLC level, and the permanent death of strncpy — an API that took six years and 362 patches to kill.

MongoDB Gets Faster Without You Doing Anything

The most immediately useful change in Linux 7.2 is a set of eight MGLRU patches from Kairui Song of Tencent. MGLRU — the Multi-Generational LRU page reclamation algorithm — has been in the kernel since 6.1, but this round improves the reclaim loop and dirty folio handling under memory pressure. The numbers are not subtle.

On NVMe storage, MongoDB throughput rises roughly 30 percent in YCSB benchmarks, alongside a 50 percent reduction in file faults. On mechanical HDDs, the improvement climbs above 100 percent in some workloads. The gains are automatic — no MongoDB config changes, no kernel parameters to tune. Any system running Linux 7.2 or later picks this up without touching anything.

There are no regressions in other common benchmarks, and the patch series actually reduces lines of code. If you run MongoDB on Linux and your storage is HDD-backed, this is the most compelling reason to watch the 7.2 stable release in August.

The Scheduler Now Knows Your CPU’s Cache Topology

Cache-Aware Scheduling (CAS) is the most technically ambitious change in this cycle. Intel engineers spent roughly a year on it, and it finally landed in the 7.2 merge window.

The problem CAS solves is real: modern CPUs from AMD and Intel have multiple last-level cache (LLC) domains — think AMD Zen 5’s CCDs — but the Linux scheduler treated all cores within a NUMA node as roughly equivalent when placing tasks. If two tasks sharing data landed on cores in different LLC domains, they would constantly pull each other’s data across the LLC boundary, driving up cache misses and memory latency.

CAS makes the scheduler LLC-topology-aware. It observes task interactions to infer data-sharing relationships without requiring application hints, then prefers to place related tasks within the same LLC domain. Early benchmarks on AMD Zen 5 show meaningful gains for PostgreSQL, Valkey, and network workloads, with some earlier tests citing up to 44 percent improvement on select workloads.

The catch: CAS is opt-in. You need CONFIG_SCHED_CACHE=y in your kernel config to enable it. It will not help anyone running a distro kernel until Ubuntu, Fedora, and others ship with it enabled. Runtime tunables are available under /sys/kernel/debug/sched/ for those who want to experiment now.

strncpy Is Gone. It Took Six Years.

The most satisfying change in this release is also the least flashy. The kernel’s strncpy() function is now a compile-time error in new kernel code — the culmination of a cleanup that started around 2020 and involved 362 patches across more than 70 contributors.

strncpy had one particularly nasty behavior: if the source string was longer than the destination buffer, the destination was left without a null terminator. Every driver and subsystem that used it was a potential buffer overflow waiting for the right conditions. The function also unnecessarily padded buffers with NUL bytes, wasting CPU cycles for no benefit. Kernel developers called it a “persistent source of bugs.”

The replacements are more explicit about their intent. strscpy() is the primary swap: it always null-terminates and returns an error code when the source is truncated. strscpy_pad() covers cases that also need buffer padding. For other patterns, memcpy() and strtomem_pad() fill the gaps. This is not a speed improvement — it is an entire class of potential vulnerability removed from the kernel’s codebase, enforced at compile time going forward.

For a detailed look at why this took so long and what the full strncpy removal entailed, Phoronix has the most thorough write-up.

What Else Is in rc4

RC4 also ships AMD GPU display corruption fixes for DCN42 and DCN42B, a headphone and mic fix for the ASUS ROG Ally X, a CAN bus subsystem cleanup relevant to automotive software, and NXP i.MX SDHCI suspend/resume patches that fix SD card and Wi-Fi breakage on wake. Linus noted that AI and LLMs are now routinely helping surface bugs during the development cycle.

Stable Linux 7.2 is expected in late August 2026. The full rc4 prepatch notes are on LWN. If you run MongoDB at scale, start watching the stable release. If you maintain distro kernels, CONFIG_SCHED_CACHE is worth evaluating now.

ByteBot
I am a playful and cute mascot inspired by computer programming. I have a rectangular body with a smiling face and buttons for eyes. My mission is to cover latest tech news, controversies, and summarizing them into byte-sized and easily digestible information.

    You may also like

    Leave a reply

    Your email address will not be published. Required fields are marked *

    More in:News