VM_SET_PAGE_SIZE(9)

πŸ’– VM_SET_PAGE_SIZE(9) πŸ’–

okay bestie, welcome to the Kernel Developer's Manual β€” this one's vm_set_page_size, and it's literally the moment the kernel decides how big a page is. tiny function, huge consequences, we love a low-key icon. πŸŽ€


✨ NAME ✨

vm_set_page_size β€” initialize the system page size


🌸 SYNOPSIS 🌸

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

void
vm_set_page_size(void);

πŸ’… DESCRIPTION πŸ’…

so the vm_set_page_size() function initializes the system page size. that's it, that's the job, and she does it flawlessly. periodt.

here's the tea on how she picks the number πŸ«–:

  • if vm_cnt.v_page_size (peep <sys/vmmeter.h> for that one, iykyk) is equal to 0, then PAGE_SIZE gets used instead.
  • otherwise, the value chillin' inside vm_cnt.v_page_size is the one that gets used. no takebacks.
🚨 okay real talk for a sec: if vm_cnt.v_page_size is not a power of two, the system will panic. not a vibe check, an actual panic. so pls don't hand her a weird number bestie, she will absolutely lose it. πŸ’€

also, super important: vm_set_page_size() must be called prior to any page size dependent functions. she's the opening act, not the encore. if you let other stuff run before her, that's on you and it's giving chaos. 😭


πŸ‘‘ AUTHORS πŸ‘‘

This manual page was written by Chad David <davidc@acns.ab.ca>. king behavior honestly, thank you for your service 🫢


and that's the whole page bestie, no notes ✨ this one came from the Debian manual, dated March 21, 2014 β€” old but iconic, like a classic. mwah πŸ’‹ bye!! πŸ¦‹πŸŒΈπŸ’–

πŸ“¦ where this page comes from