collapse_pte_mapped_thp(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ collapse_pte_mapped_thp(9) ✨

okay bestie, welcome to the Kernel API Manual πŸ’… this is the page for collapse_pte_mapped_thp, and yes it's a real function, and yes it's kind of a big deal 🌸


🌟 NAME 🌟

collapse_pte_mapped_thp β€” the way it tries to collapse a pte-mapped THP for mm at address haddr 🫢 literally that's the whole thing, no cap.


πŸŽ€ SYNOPSIS πŸŽ€

void collapse_pte_mapped_thp (struct mm_struct *mm , unsigned long addr
, bool install_pmd );

three args, one void return, zero drama πŸ’–


🧚 ARGUMENTS 🧚

  • mm β€” the process address space where the collapse happens. it's giving "whose memory are we doing this to" energy πŸ‘‘
  • addr β€” the THP collapse address. this is where the magic goes down ✨
  • install_pmd β€” if a huge PMD should be installed. yes/no, true/false, iconic/iconic-er πŸ’…

πŸ”₯ DESCRIPTION πŸ”₯

so here's the tea, bestie β˜• this function goes and checks whether all the PTEs in the PMD are pointing to the right THP. that's the vibe check first, always πŸ•΅οΈβ€β™€οΈ

and if they are β€” slay β€” it retracts the page table so the THP can refault in with as pmd-mapped. it's basically clearing the runway so the big page can land properly πŸ›¬βœ¨

possibly it'll also install a huge PMD mapping the THP. that's the install_pmd flag doing its main character thing πŸ™ˆπŸ’œ


🌈 SEE ALSO 🌈

go read these next, bestie, iykyk πŸ“š


πŸ’€ reminder: keep every one of those references intact when you cite them, fr fr β€” they're the whole friend group and nobody gets left behind 🫢

and that's the page!! tysm for reading, mwah πŸ˜­πŸ’– this one shipped out of ./mm in October 2026 β€” go forth and collapse those pte-mapped THPs, you absolute icon πŸŒΈπŸ‘‘

πŸ“¦ where this page comes from