VM_PAGE_RENAME(9)

πŸ’– VM_PAGE_RENAME β€” move a page πŸ’–

okay bestie, this one's a <pink>Kernel Developer's Manual</pink> page, section 9, and it's literally about moving a page from one place to another. tiny function, big responsibilities. let's get into it ✨


🌸 NAME 🌸

vm_page_rename β€” move a page πŸ¦‹


✨ SYNOPSIS ✨

first you gotta pull in the headers, no skipping:

#include <sys/param.h>
#include <vm/vm.h>
#include <vm/vm_page.h>

void
vm_page_rename(vm_page_t m, vm_object_t new_object,
    vm_pindex_t new_pindex);

it returns void, so like… it gives nothing back. it just does the thing. main character energy honestly πŸ’…


πŸ’œ DESCRIPTION πŸ’œ

so here's the vibe: vm_page_rename() removes a page from one object and adds it to another, at whatever page index you tell it. the page gets added to the object you hand it, and removed from the object it's currently associated with. it's giving "moving out, new lease, no forwarding address" πŸŽ€

now the ✨tea✨: if the page is currently sitting on the cache queue, it will be deactivated β€” unless it's wired or unmanaged, in which case, bestie, the deactivation will simply fail. no cap. 😭

and after the whole move is done, the entire page is marked as dirty. every last bit of it. it's been through something, okay? πŸ’€


🧚 the arguments (yes, all three of them) 🧚

  • m β€” the page you're moving. the little guy in transit. 🚚
  • new_object β€” the object the page should be inserted into. its new home 🏑
  • new_pindex β€” the page index into new_object at which the new page should be inserted. like, the exact spot on the shelf. πŸ“

πŸ‘‘ AUTHORS πŸ‘‘

this manual page was written by Chad David <davidc@acns.ab.ca>. thank you chad, we appreciate you fr fr 🫢


and that's the whole page, bestie! this one's from the Debian release, dated July 17, 2001 β€” yeah, it's an elder, but it still ate. periodt. πŸ’–βœ¨πŸŒΈπŸ¦‹

πŸ“¦ where this page comes from