replace_page(9)
πΈ 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 topage. She's the container, the context, the main character holding the pointer energy. π«Άpageβ the page we are replacing bykpage. Literally the one getting swapped out, no drama. πkpageβ the ksm page we replacepageby. 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 β0for success,-EFAULTfor failure. Don't go adding extra lore, iykyk. π
π¦ SEE ALSO π¦
Go peek at these related icons when you're done slaying this page:
- Kernel file
./mm/ksm.c Overview(9)struct ksm_mm_slot(9)struct ksm_scan(9)struct ksm_stable_node(9)struct ksm_rmap_item(9)struct advisor_ctx(9)ksm_do_scan(9)ksm_vma_flags(9)ksm_enable_merge_any(9)ksm_disable_merge_any(9)
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
- 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