Song Liu drops a Kconfig promise in 2019: writable huge pages for the page cache, just “in the next few release cycles.” Cut to 2025. That option’s toast. Gone. Poof.
And here’s the kicker — the read-only transparent huge pages it was built on? They’re getting the boot too. Kernel devs realized the memory subsystem had evolved right past this relic. No fanfare. No apology. Just a commit saying, ‘Nah, not worth it.’
Read-only transparent huge pages sounded smart back then. Collapse 4K pages into 2MB beasts for the page cache — faster lookups, less TLB thrashing. Servers would purr. But reality bit hard.
Look, the page cache isn’t some static playground anymore. Multi-generational LRU. Tiered memory. Folios everywhere. THP bolted on top? It clashed. Wasted effort maintaining a feature nobody tuned for writability anyway.
Things do not always go the way kernel developers think they will.
That’s from the original patch notes — prophetic, isn’t it? Song Liu’s work landed in Linux 5.5. Enthusiasm high. But six years on, it’s a zombie feature. Enabled by default? Nope. Most configs ignored it. Why bother with read-only when anon THP rules the roost?
Why Dump Read-Only Transparent Huge Pages Now?
Core memory subsystem shifted. Folios — kernel’s new page love language — make huge pages less special. No need for awkward read-only hacks in the cache. Performance gains? Negligible in benchmarks. Bugs? Plenty. Collapsing cache pages into THP led to weird reclaim issues, especially under memory pressure.
Kernel maintainers weighed costs. Patches piled up fixing edge cases. Userspace didn’t scream for it. So, rip it out. Cleaner code. Fewer headaches. Linus probably nodded — he hates vestigial crap.
But wait. That Kconfig lie still lingers in 6.19. “Writable support coming soon.” Hilarious. Devs patched it out last cycle. Commit by Matthew Wilcox, folio evangelist: disable at build time, then nuke.
Short para for punch: Brutal efficiency.
Now, zoom out. This isn’t just housekeeping. It’s Linux kernel’s Darwinian side — features mutate or die. Remember file THP? Hype in 2015. Fizzled. Or zram’s wild promises? Tamed. Read-only THP for page cache joins the graveyard.
My hot take — unique angle you won’t find in LWN: this mirrors the Netscape browser wars. Early 90s, huge pages were the “frames” of memory tech — flashy, but fragmented the web… er, cache. Kernel’s pruning it like Mozilla torched Netscape’s bloat. Prediction? By 6.15, folios swallow all THP drama. Page cache goes fully folio-huge, no transparency needed. Servers shave 1-2% latency. You’re welcome.
Does Removing Read-Only THP Hurt Performance?
Panic? Don’t. Benchmarks from Red Hat and SUSE show zip. Page cache collapse was niche — think read-heavy workloads on ancient hardware. Modern NUMA boxes? Folios + MADV_HUGEPAGE do better.
Test it yourself. Boot a 6.12-rc kernel with CONFIG_READ_ONLY_THP_FOR_FS= n. Run fio on a tmpfs mount. Numbers barely twitch. Humor me: it’s like removing training wheels from a Harley.
Devs spun it as ‘core changes underneath.’ True. But let’s call the PR: they overpromised to land the feature. Song Liu wanted eyes on his code. Mission accomplished — then reality struck.
Dense para time. Consider the ripple: filesystem devs rejoiced. No more XFS/Btrfs quirks dancing around THP splits. Reclaim smoother — no huge-page bias starving small pages. Power users tweaking /sys/kernel/mm/transparent_hugepage? One less knob. Good riddance. And for cloud? AWS Graviton laughs — their THP tweaks never leaned on this.
One sentence: Progress tastes like ashes sometimes.
What Killed the Writable Dream?
Writability was the unicorn. Page cache writes mean dirtiness, migration hell. Splitting 2MB on COW? Nightmare. Devs poked at it — patches in 2021, 2023. All stalled. Folios obsoleted the approach. Why hack writable THP when multi-order folios handle it natively?
Humor break: It’s like promising a flying car, then scrapping wheels because jets exist.
Users? Forums lit up in 2022 — ‘Enable RO THP cache!’ Crickets now. Nobody cared enough to maintain it. Kernel’s meritocracy at work.
And the corporate angle — Red Hat pushed folios hard. IBM too. This removal? Their fingerprints. Skeptical? Check Wilcox’s mail list rants. He’s been THP-skeptic since day one.
Para asymmetry: Boom.
Longer wind: Dive into history. THP debuted 2009 for anon memory — swap-friendly hugepages. File cache? Afterthought. 2019 patch set assumed symmetry. Wrong. Cache pages fragment differently — reads interleave with writes, madvise hints ignored. Result? Half-baked collapse rates under 10% on real workloads. Not worth the VM pressure.
Linux Kernel’s Pruning Spree: Bigger Picture
This fits a pattern. Kernel 6.x shed khugepaged tweaks, zswap hacks, even old slab allocators. Bloat beware. Upcoming 7.0? More cuts. My bold call: multi-gen LRU eats another 5% of mm/ code by 2027.
Critic hat: Devs, stop Kconfig teases. Users read ‘em. False hope kills trust. Song Liu moved on — perf tools now. No hard feelings. But lesson? Prototype in-tree, sure. Promise eternity? Nah.
Quick hit: Servers worldwide unaffected. Your distro kernel? Already patched.
Expansive close: Think of the devs grinding late nights on split/merge logic, only for git reset –hard. Poignant. Yet necessary. Linux endures because it sheds skin like a snake — stronger each molt.
**
🧬 Related Insights
- Read more: React Server Components: Three New CVEs Expose DoS Crashes and Source Code Leaks
- Read more: One Dev’s Year-Long Rewrite Nightmare: Why Estimates Always Lie
Frequently Asked Questions**
What are transparent huge pages in Linux?
THP auto-collapses 4K pages into 2MB/1GB giants for less overhead. Anon memory staple since 2.6.32. Page cache version? Dead.
Why remove read-only THP for page cache?
Memory subsystem evolved — folios, MGLRU obsoleted it. Buggy, low adoption, no writable path.
Will this break my applications?
Nope. Feature barely used. Enable folios instead for gains.