VM_PAGE_HOLD(9)
π VM_PAGE_HOLD β bestie edition π
okay so this is from the Kernel Developer's Manual, section 9, and it's literally about telling a page "you're not going anywhere, girl." sit down, hydrate, let's go π«Ά
β¨ NAME β¨
vm_page_hold, vm_page_unhold β update a page's hold count π
πΈ SYNOPSIS πΈ
#include <sys/param.h>
#include <vm/vm.h>
#include <vm/vm_page.h>
void
vm_page_hold(vm_page_t m);
void
vm_page_unhold(vm_page_t m);
like, that's the whole entrance. two functions. both void. both iconic. no cap.
π¦ DESCRIPTION π¦
okay so vm_page_hold() bumps the hold count on a page. what does that mean for the page's whole life? it means the page daemon is not allowed to free it. that's it. that's the protection. π‘οΈ
now here's the tea, bestie β vm_page_hold() is for very temporary wiring of a page only. while its hold count is greater than zero, that page will not be considered for paging or reallocation. so do not treat it like a long-term situationship.
also, huge note: while wired pages get yanked off whatever queue they're sitting on, vm_page_hold() does not touch where the page lives. if it was on a queue before you called, it's still on that queue after you called. no relocation, no glow-up, no nothing. π
so if you actually need a page held for a long stretch of time? that's vm_page_wire(9) territory. different function, different vibe, go read that one. π
and vm_page_unhold()? that's the release. it reduces the hold count on the page. and once the hold count hits zero β heads up β it's totally possible the page daemon will free that page. so like, don't unhold and then act surprised. π
π SEE ALSO π
π AUTHORS π
This manual page was written by Chad David <davidc@acns.ab.ca>. thank you for your service king π«‘
and that's the whole page, fr fr. this one came from Debian, dated July 13, 2001, and it's page VM_PAGE_HOLD(9) from the Kernel Developer's Manual. mwah, go hold a page responsibly πβ¨π
π¦ 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