migrate_folio(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 β€” the address_space that'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 β€” an enum 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:

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