collapse_pte_mapped_thp(9)
β¨ 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 π
- Kernel file
./mm/khugepaged.cβ the source, the origin, the mothership π§ struct khugepaged_scan(9)collapse_max_ptes_none(9)collapse_max_ptes_shared(9)collapse_max_ptes_swap(9)collapse_file(9)
π 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms