Linux Kernel 7.0 Speeds Up File Cache Memory Reclaim by Up to 75%

2 min read Original article ↗

In the latest Linux kernel v7.0, freeing up system memory used for caching large files has received a noticeable performance boost. According to notes on the kernel mailing list, a new set of patches queued for the Linux 7.0 merge window showed reclaim speed improvements of up to 75% in testing. In one benchmark, developers allocated 10 GB of file-backed data in memory and then reclaimed 8 GB of it. On a 32-core Arm64 server, the reclaim process completed about 75% faster compared to the older Linux implementation, while on an x86 machine, the improvement was reported at over 50%.

Imagine your system running a large database or another memory-intensive workload. Instead of constantly reading from storage, the kernel can keep tens or even hundreds of gigabytes of frequently accessed file data in RAM for much faster access. When memory pressure builds and part of that cached data must be freed, the cleanup process now completes significantly faster. This is not going to be noticeable to consumers, but hyperscalers, HPC simulations, AI runs, and other workloads that involve heavy data processing will now see a significant performance boost. The improvement comes from work authored by Baolin Wang of Alibaba, who optimized how the kernel handles large blocks of cached file memory.

It's important to note that this is just one benchmark that has been tested. We're on the path to Linux 7.0, which means real-world workloads have yet to experience the speed improvements the Linux kernel will bring. Recently, development has concentrated on crucial areas like task scheduling and memory management, as we're witnessing now. This is a positive sign of healthy development, with potential future improvements benefiting the ever-growing community of Linux gamers. As long as these kernel improvements continue to build, development remains on a solid track.