diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -397,6 +397,7 @@ vm_map_submap.9 \ vm_map_sync.9 \ vm_map_wire.9 \ + vm_page.9 \ vm_page_advise.9 \ vm_page_alloc.9 \ vm_page_bits.9 \ @@ -2364,6 +2365,7 @@ vm_map_max.9 vm_map_pmap.9 MLINKS+=vm_map_stack.9 vm_map_growstack.9 MLINKS+=vm_map_wire.9 vm_map_unwire.9 +MLINKS+=vm_page.9 vm_page_t.9 MLINKS+=vm_page_alloc.9 vm_page_alloc_after.9 \ vm_page_alloc.9 vm_page_alloc_contig.9 \ vm_page_alloc.9 vm_page_alloc_contig_domain.9 \ diff --git a/share/man/man9/vm_page.9 b/share/man/man9/vm_page.9 new file mode 100644 --- /dev/null +++ b/share/man/man9/vm_page.9 @@ -0,0 +1,82 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2023 The FreeBSD Foundation +.\" +.\" This manual page was written by Mitchell Horne under +.\" sponsorship from the FreeBSD Foundation. +.\" +.Dd July 11, 2023 +.Dt VM_PAGE 9 +.Os +.Sh NAME +.Nm vm_page , +.Nm vm_page_t +.Nd "virtual memory page structure" +.Sh SYNOPSIS +.In sys/param.h +.In vm/vm.h +.In vm/vm_page.h +.Bd -literal +struct vm_page; +.Ed +.Vt typedef "struct vm_page *vm_page_t" ; +.Sh DESCRIPTION +The +.Vt vm_page_t +structure is the logical representation of a virtual memory page. +Every page of resident physical memory has a corresponding +.Vt vm_page_t . +.Pp +Free +.Vt vm_page_t +objects are managed by the physical memory allocator, and reserved by +higher-level allocaters like +.Xr uma 9 . +When a page is freed, for example by calling +.Xr vm_page_free 9 , +it will be returned to the physical allocator. +.Pp +While in active use, a +.Vt vm_page_t +will most commonly belong to a specific VM object +.Pq Vt vm_object_t , +and it will be linked to the lifecycle of that object. +.Ss Virtual Address Mappings +While in active use, a +.Vt vm_page_t +will have corresponding virtual address mappings in one or more separate +virtual address spaces. +.Pp +The logical portion of address space management is handled by the +.Xr vm_map 9 +KPI. +The actual virtual-to-physical address mappings (page tables) for a memory page +are managed by the machine-dependent +physical map module, +.Xr pmap 9 . +Some of its routines operate on +.Vt vm_page_t +objects, for example +.Xr pmap_enter 9 . +.Vt struct vm_page +contains a machine-dependent sub-structure +.Pq Vt struct md_page +for use within the +.Xr pmap 9 +module. +.Sh SEE ALSO +.Xr pmap 9 , +.Xr vm_map 9 , +.Xr vm_page_advise 9 , +.Xr vm_page_aflag 9 , +.Xr vm_page_alloc 9 , +.Xr vm_page_bits 9 , +.Xr vm_page_busy 9 , +.Xr vm_page_free 9 , +.Xr vm_page_grab 9 , +.Xr vm_page_insert 9 , +.Xr vm_page_lookup 9 , +.Xr vm_page_queue 9 , +.Xr vm_page_rename 9 , +.Xr vm_page_wire 9