migrate_folio(9)
β¨ migrate_folio(9) β¨
okay so this is a page from the Kernel API Manual, and tbh it's a whole mood: it's the little helper that does migrate_folio β simple folio migration. π
πΈ NAME πΈ
migrate_folio β Simple folio migration. that's it, that's the vibe. short, sweet, slays. π
π¦ SYNOPSIS π¦
int migrate_folio (struct address_space *mapping , struct folio *dst ,
struct folio *src , enum migrate_mode mode );
like, it returns an int bestie, don't forget that part π
π ARGUMENTS π
mappingβ theaddress_spacethat's holding the folio. it's giving "where does this live" energy.dstβ the folio you're migrating the data to. the destination, the new home, the main character π β¨srcβ the folio that's holding the current data right now. the one being moved out, rip π₯²modeβ anenum migrate_mode, aka how to migrate the folio. the vibe check for the whole operation.
π₯ DESCRIPTION π₯
So this is the common logic to directly migrate a single LRU folio, and it's specifically suitable for folios that do not have private data. no private data? then this is literally your girl π«Ά
Also super important, no cap: folios are locked upon entry and exit. π so you walk in locked and you walk out locked, periodt.
π SEE ALSO π
Kernel file ./mm/migrate.c, plus these iconic little friends:
isolate_movable_ops_page(9)putback_movable_ops_page(9)migrate_movable_ops_page(9)buffer_migrate_folio(9)buffer_migrate_folio_norefs(9)
iykyk, go read them next π
π¦ ok that's the whole page bestie, ily, go migrate some folios responsibly π
source lives in ./mm, dated October 2026, and yes this was migrate_folio(9) the whole time ππ
π¦ 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