PMAP_QUICK_ENTER_PAGE(9)
π PMAP_QUICK_ENTER_PAGE(9) π
okay so bestie, welcome to PMAP_QUICK_ENTER_PAGE(9) from the Kernel Developer's Manual β the page about two kernel functions that manage fast, single-page kernel address space mappings. No cap, theyβre lowkey iconic. π
πΈ NAME πΈ
pmap_quick_enter_page,pmap_quick_remove_pageβ manage fast, single-page kernel address space mappings. periodt.
β¨ SYNOPSIS β¨
#include <sys/param.h>
#include <vm/vm.h>
#include <vm/pmap.h>
vm_offset_t
pmap_quick_enter_page(vm_page_t m);
void
pmap_quick_remove_page(vm_offset_t kva);
π¦ DESCRIPTION π¦
The pmap_quick_enter_page() function accepts a single page m, and enters this page into a preallocated address in kernel virtual address (KVA) space. This function is intended for temporary mappings that will only be used for a very short period, for example a copy operation on the page contents. Itβs giving βin and out, quick little mapping moment.β β¨
The pmap_quick_remove_page() function removes a mapping previously created by pmap_quick_enter_page() at kva, making the KVA frame used by pmap_quick_enter_page() available for reuse. Cleanup queen behavior. π
On many architectures, pmap_quick_enter_page() uses a per-CPU pageframe. In those cases, it must disable preemption on the local CPU. The corresponding call to pmap_quick_remove_page() then re-enables preemption. It is therefore not safe for machine-independent code to sleep or perform locking operations while holding these mappings. Like, do not nap while holding the mapping, bestie β thatβs the whole vibe check. π
Current implementations only guarantee the availability of a single page for the calling thread, so calls to pmap_quick_enter_page() must not be nested. Ngl, that means no nesting these calls β one page at a time, fr fr. π«Ά
pmap_quick_enter_page() and pmap_quick_remove_page() do not sleep, and pmap_quick_enter_page() always returns a valid address. It is safe to use these functions under all types of locks except spin mutexes. It is also safe to use them in all thread contexts except primary interrupt context. So: all locks except spin mutexes, and all thread contexts except primary interrupt context. Got it? Got it. β
β οΈ The page must not be swapped or otherwise reused while the mapping is active. It must be either wired or held, or it must belong to an unmanaged region such as I/O device memory. This is a hard no β the page has to stay put while the mapping is alive. π¨
π RETURN VALUES π
The pmap_quick_enter_page() function returns the kernel virtual address that is mapped to the page m. Literally the address, bestie. Slay. β¨
π SEE ALSO π
π AUTHORS π
This manual page was written by Jason A Harmening <jah@FreeBSD.org>. Iconic behavior from Jason, honestly. π
π sign-off: this page is from Debian, dated August 6, 2015 β PMAP_QUICK_ENTER_PAGE(9) is out. Stay mapped, bestie. πβ¨π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2015 Jason A. Harmening <jah@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms