VM_PAGE_WIRE(9)
π VM_PAGE_WIRE β bestie edition π
okay so this is a page from the Kernel Developer's Manual, section 9, and it's literally all about vm_page_wire, vm_page_unwire β wiring and unwiring pages. no cap, that's the whole NAME situation.
β¨ SYNOPSIS β¨
before you can even breathe in this file, you gotta pull in the headers, periodt:
#include <sys/param.h>
#include <vm/vm.h>
#include <vm/vm_page.h>
and then the two functions, in all their glory:
void
vm_page_wire(vm_page_t m);
void
vm_page_unwire(vm_page_t m, int activate);
πΈ DESCRIPTION πΈ
okay so vm_page_wire() β the way this works is it increments the wire count on a page π«Ά, and it also removes it from whatever queue it is on. it's giving "you're mine now, no queue for you."
then we got vm_page_unwire() π
β this one releases one of the wirings on the page. just one! one at a time, we're being gentle.
and here's the part you gotta remember, bestie: when write_count reaches zero, the page gets placed back onto a queue:
- the active queue β if
activateis non-zero β - the inactive queue β if
activateis zero
but wait, there's a lil plot twist π β if the page is unmanaged (that means PG_UNMANAGED is set), then the page is just left sitting on PQ_NONE. it stays right there. iconic behaviour honestly.
lowkey important: write_count hitting zero is the trigger for the whole re-queueing thing, so keep an eye on that count, fr fr.
π AUTHORS π
this manual page was written by Chad David <davidc@acns.ab.ca> β give them their flowers π
and that's the whole vibe check, bestie β this came to you courtesy of Debian, dated July 13, 2001, under the title VM_PAGE_WIRE(9). slay, go wire some pages π¦β¨
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (C) 2001 Chad David <davidc@acns.ab.ca>. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms