folio_isolate_hugetlb(9)
π folio_isolate_hugetlb β kernel API manual, bestie edition β¨
okay so picture this: you're deep in ./mm/hugetlb.c territory, the Kernel API Manual is open, and you need to know about folio_isolate_hugetlb(9). Welcome, you're in the right group chat π«Ά
πΈ NAME πΈ
folio_isolate_hugetlb β literally just trying to isolate an allocated hugetlb folio, no big deal π
β¨ SYNOPSIS β¨
bool folio_isolate_hugetlb (struct folio *folio , struct list_head *list
);
like yes bestie it returns a bool, we love a yes-or-no icon π
π ARGUMENTS π
folioβ the folio we're trying to isolate. main character energy fr fr.listβ the list we plop that folio onto on success. bestie gets a new home π
π¦ DESCRIPTION π¦
okay so here's the vibe: this function isolates an allocated (refcount > 0) hugetlb folio. it marks it as isolated/non-migratable and moves it from the active list over to whatever list you handed it. slay.
so when does it flop? isolation fails if folio is not an allocated hugetlb folio, or if it's already isolated/non-migratable. like, it's already booked and busy, respect that π
on success, an additional folio reference is taken, and you must drop it using folio_putback_hugetlb to undo the isolation. do not forget this or you will simply have a bad time π¨
β RETURN β
True if isolation worked, otherwise False. that's it, that's the whole answer π
π SEE ALSO π
- Kernel file
./mm/hugetlb.c(the source of truth, go read it iykyk) hugetlb_alloc_folio(9)huge_pmd_unshare(9)folio_putback_hugetlb(9)
and that's the page!! brought to you by ./mm, dated October 2026, living in the Kernel API Manual π go forth and isolate responsibly, bestie π§β¨
π¦ 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