Reserved THP Feature Proposed For Linux To Combine The Best Of HugeTLB & THP - Phoronix
Articles & Reviews
News Archive
Forums
Premium Ad-Free<br>Contact
Popular Categories
Close
Articles & Reviews
News Archive
Forums
Premium
Contact
Categories
Computers Display Drivers Graphics Cards Linux Gaming Memory Motherboards Processors Software Storage Operating Systems Peripherals
Reserved THP Feature Proposed For Linux To Combine The Best Of HugeTLB & THP
Written by Michael Larabel in Linux Kernel on 27 June 2026 at 12:50 PM EDT. 3 Comments
Linux kernel developer and Bytedance engineer Qi Zheng sent out a request for comments (RFC) patch series on a new feature called Reserved THP to combine the best of HugeTLB and THP kernel functionality.
Bytedance has been working on Reserved THP as a potential stepping stone or goal of unifying HugeTLB and Transparent Huge Page (THP) support within the Linux kernel for kernel huge pages. HugeTLB brings nice elements like reservations and guaranteed allocation within reserved pools, but not supporting swap. Meanwhile, THP doesn't support reservations and allocations aren't guaranteed, but is more tightly integrated with the core memory management code and can handle swap.
Qi Zheng explained of their experience in coming up with the idea of Reserved THP:<br>"In our internal scenario, a user process needs to reserve double the amount of Hugetlb memory due to hot-upgrade requirements. For example, if the process needs 16GB of Hugetlb, an additional 16GB is required during the hot-upgrade to satisfy memory allocations. After the upgrade, the old process exits and releases the 16GB of HugeTLB. Therefore, in most cases, the extra 16GB of HugeTLB is wasted.
A straightforward idea is to use the Hugetlb CMA feature, reserving a total of 32GB of hugetlb_cma. During normal operation, 16GB is consumed, and the remaining 16GB can be used by other processes. During hot-upgrade, we could try to migrate the memory used by other processes to allocate the required extra 16GB of Hugetlb. This might work, but it still requires reserving 32GB of memory.
We also found that during the hot upgrade, about 10GB of the old process's hugetlb is actually cold memory, which could theoretically be reclaimed. In extreme cases, we could reserve only 22GB of memory and reclaim the remaining 10GB during the hot upgrade. But unfortunately, hugetlb currently does not support swap, and supporting it seems quite difficult.
Therefore, we are wondering if we can introduce "reserved THP", which is THP that can be reserved. It can be consumed through methods like madvise(), while normal memory allocation cannot consume it. This can achieve an effect similar to hugetlb. And because it is THP, it can relatively easily support swap features, which perfectly solves the above problem."
In prior years there have been kernel discussions over unifying THP and HugeTLB albeit still separate to date.
Those wanting to learn more about this Reserved THP proposal can do so via this LKML patch series.
3 Comments
Tweet
Linux 7.2 Fixes Where PCIe Devices Could Be Inadvertently Restricted To 2.5 GT/s<br>Linux 7.2 Drops Ancient PROFIBUS Driver: Ported From SCO Unix In 1998, Unused For Years<br>Linux Cache Aware Scheduling Extended For Even Better Performance: Up To 360% In MySQL<br>MGLRU Improvement Yielding Nice Gains On Linux 7.2: MongoDB 30~100% Higher Throughput<br>Linux 7.2 Protects Against Crafted Perf Data From Going Rogue<br>Linux 7.2 Ready With IMA and EVM Post-Quantum ML-DSA Signature Support
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.
Linux Finally Eliminates The strncpy API After Six Years Of Work, 360+ Patches<br>systemd 261 Released With New systemd-sysinstall OS Installer, IMDSD & Storagectl<br>"Disgusting" Linux sched_ext Source Code Restructured Following Complaint By Linus Torvalds<br>Open-Source NVIDIA NVK Vulkan Driver Now Supports DLSS<br>Google's Gemini Partially Figures Out A Lengthy Linux Boot Time On Modern ASUS Laptop<br>Steam Machine Launches, Priced $1049 To $1428 USD<br>One Line x86 Change To GCC Compiler Nets +12% Benchmark Win For Modern Intel/AMD CPUs<br>GIMP v0.54 From 1996 With Motif Toolkit Now Flatpak'ed For Modern Linux Desktops
Reserved THP Feature Proposed For Linux To Combine The Best Of HugeTLB & THP
Linux MD RAID5 Seeing Scalability Improvements Up To 17%
GNOME AI Assistant Adds Image Generation Support
KDE Plasma 6.7.2 To Fix KWin's Most Common Crash, Plasma 6.8 To Not Crash When Ejecting CDs
COSMIC's New System Monitor Is Looking Very Slick
Shotcut...