migrate_movable_ops_page(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 an enum 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, the folio refcounts on src and dst are 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 πŸ’œ

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