replace_page(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

okay so bestie, welcome to the Kernel API Manual β€” we're looking at replace_page(9), and honestly it's giving "short king with a very specific job." πŸ’…

The official vibe is: replace page in vma by new ksm page. That's the whole name, no cap. ✨


✨ SYNOPSIS ✨

int replace_page (struct vm_area_struct *vma , struct page *page ,
       struct page *kpage , pte_t orig_pte );

πŸŽ€ ARGUMENTS πŸŽ€

  • vma β€” the vma that holds the pte pointing to page. She's the container, the context, the main character holding the pointer energy. 🫢
  • page β€” the page we are replacing by kpage. Literally the one getting swapped out, no drama. πŸ’€
  • kpage β€” the ksm page we replace page by. The new bestie stepping in. πŸ‘‘
  • orig_pte β€” the original value of the pte. Keep it exactly as-is, bestie; we don't invent pte lore here. πŸŽ€

πŸ’– DESCRIPTION πŸ’–

The return situation is super straightforward: it returns 0 on success, and -EFAULT on failure. That's it. That's the vibe check. 🌈

bestie, those are the only return values listed here β€” 0 for success, -EFAULT for failure. Don't go adding extra lore, iykyk. 😭

πŸ¦‹ SEE ALSO πŸ¦‹

Go peek at these related icons when you're done slaying this page:


mwah πŸ’‹ and that's the cute little sign-off: this page's source/version is ./mm, dated October 2026, and it's still our girl replace_page(9). bye bestie, go read those SEE ALSOs fr fr πŸ¦‹πŸ’–

πŸ“¦ where this page comes from