migrate_movable_ops_page(9)
π migrate_movable_ops_page(9) β like, the whole kernel API manual tea π«Ά
okay so bestie, welcome to the glow-up of migrate_movable_ops_page(9) from the Kernel API Manual β¨ pull up a chair, we're learning kernel migration and honestly? it's giving main character energy π
πΈ NAME πΈ
migrate_movable_ops_page β the function that migrates an isolated movable_ops page. that's it, that's the vibe π«
β¨ SYNOPSIS β¨
int migrate_movable_ops_page (struct page *dst , struct page *src , enum
migrate_mode mode );
π ARGUMENTS π
dstβ the destination page, aka where we're going, the new home bestie π‘srcβ the source page, aka the one being moved out of its current situation π¦modeβ the migration mode. yes it's anenum migrate_mode, no I will not be elaborating further, that's literally all the page says π
π¦ DESCRIPTION π¦
so the whole point: migrate an isolated movable_ops page. lowkey simple to say, absolutely not simple underneath, iykyk π
here's the three scenarios, and yes there are three, keep up:
scenario one β src was already released by its owner π
if the src page was already released by its owner, the src page gets un-isolated (putback) and the migration succeeds. and then? the migration core becomes the owner of both pages. both. of them. periodt π
scenario two β src was NOT released, and migration worked out π
if the src page was not released by its owner and the migration was successful, then the owner of the src page and the dst page get swapped, and the src page is un-isolated. it's giving tradesies, it's giving mutual exchange π
scenario three β migration fails π
if migration fails, ownership stays exactly as it was, unmodified, untouched, no notes β and the src page remains isolated. which means you have options: you can retry the migration later, or you can put the page back. no pressure, we can run it back bestie π«Ά
β οΈ TODO energy, and this one is important β οΈ the migration core will treat both pages as folios and lock them before this call, only to unlock them after this call. further, thefoliorefcounts onsrcanddstare also released by the migration core. but these pages will not be folios in the future, so that whole arrangement has to be reworked. not me pointing at the future and screaming π₯
π RETURN VALUE, SNEAKING IN π
returns 0 on success β otherwise a negative error code. that's the whole contract, no cap β¨
π SEE ALSO π
- kernel file
./mm/migrate.cβ the actual source of truth, go read it π isolate_movable_ops_page(9)putback_movable_ops_page(9)migrate_folio(9)buffer_migrate_folio(9)buffer_migrate_folio_norefs(9)
all of these are literally in the ./mm directory, they're a whole friend group π
aaaand that's the page!! π it lives under ./mm, dropped October 2026, and the header/reference is migrate_movable_ops_page(9) just so you can cite it in your group chat with receipts π go forth and migrate responsibly, bestie, mwah π
π¦ 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