Module Name:    src
Committed By:   riastradh
Date:           Fri Jun 14 13:19:35 UTC 2024

Modified Files:
        src/distrib/sets/lists/comp: mi
        src/share/man/man9: Makefile
Added Files:
        src/share/man/man9: uvm_obj_wirepages.9

Log Message:
uvm_obj_wirepages(9): New man page.


To generate a diff of this commit:
cvs rdiff -u -r1.2457 -r1.2458 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.469 -r1.470 src/share/man/man9/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man9/uvm_obj_wirepages.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2457 src/distrib/sets/lists/comp/mi:1.2458
--- src/distrib/sets/lists/comp/mi:1.2457	Thu Mar  7 22:15:52 2024
+++ src/distrib/sets/lists/comp/mi	Fri Jun 14 13:19:35 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2457 2024/03/07 22:15:52 christos Exp $
+#	$NetBSD: mi,v 1.2458 2024/06/14 13:19:35 riastradh Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.comp				comp-sys-root
@@ -13020,6 +13020,8 @@
 ./usr/share/man/cat9/uvm_map_pageable.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/uvm_map_protect.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/uvm_meter.0		comp-sys-catman		.cat
+./usr/share/man/cat9/uvm_obj_unwirepages.0	comp-sys-catman		.cat
+./usr/share/man/cat9/uvm_obj_wirepages.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/uvm_page_physload.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/uvm_pagealloc.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/uvm_pagefree.0		comp-sys-catman		.cat
@@ -21392,6 +21394,8 @@
 ./usr/share/man/html9/uvm_map_pageable.html	comp-sys-htmlman	html
 ./usr/share/man/html9/uvm_map_protect.html	comp-sys-htmlman	html
 ./usr/share/man/html9/uvm_meter.html		comp-sys-htmlman	html
+./usr/share/man/html9/uvm_obj_unwirepages.html	comp-sys-htmlman	html
+./usr/share/man/html9/uvm_obj_wirepages.html	comp-sys-htmlman	html
 ./usr/share/man/html9/uvm_page_physload.html	comp-sys-htmlman	html
 ./usr/share/man/html9/uvm_pagealloc.html	comp-sys-htmlman	html
 ./usr/share/man/html9/uvm_pagefree.html		comp-sys-htmlman	html
@@ -29987,6 +29991,8 @@
 ./usr/share/man/man9/uvm_map_pageable.9		comp-sys-man		.man
 ./usr/share/man/man9/uvm_map_protect.9		comp-sys-man		.man
 ./usr/share/man/man9/uvm_meter.9		comp-sys-man		.man
+./usr/share/man/man9/uvm_obj_unwirepages.9	comp-sys-man		.man
+./usr/share/man/man9/uvm_obj_wirepages.9	comp-sys-man		.man
 ./usr/share/man/man9/uvm_page_physload.9	comp-sys-man		.man
 ./usr/share/man/man9/uvm_pagealloc.9		comp-sys-man		.man
 ./usr/share/man/man9/uvm_pagefree.9		comp-sys-man		.man

Index: src/share/man/man9/Makefile
diff -u src/share/man/man9/Makefile:1.469 src/share/man/man9/Makefile:1.470
--- src/share/man/man9/Makefile:1.469	Sun Jan  7 00:38:18 2024
+++ src/share/man/man9/Makefile	Fri Jun 14 13:19:35 2024
@@ -1,4 +1,4 @@
-#       $NetBSD: Makefile,v 1.469 2024/01/07 00:38:18 pgoyette Exp $
+#       $NetBSD: Makefile,v 1.470 2024/06/14 13:19:35 riastradh Exp $
 
 #	Makefile for section 9 (kernel function and variable) manual pages.
 
@@ -66,7 +66,7 @@ MAN+=	secmodel_suser.9 \
 	ubc.9 ucas.9 ucom.9 ufetch.9 uiomove.9 \
 	usbd_status.9 usbdi.9 usbnet.9 \
 	userret.9 ustore.9 \
-	uvm.9 uvm_hotplug.9 uvm_km.9 uvm_map.9 \
+	uvm.9 uvm_hotplug.9 uvm_km.9 uvm_map.9 uvm_obj_wirepages.9 \
 	vattr.9 veriexec.9 vcons.9 versioningsyscalls.9 \
 	vfs.9 vfs_hooks.9 vfsops.9 vfssubr.9 \
 	video.9 vme.9 vnfileops.9 vnode.9 vnodeops.9 vnsubr.9 vmem.9  \
@@ -1014,6 +1014,7 @@ MLINKS+=uvm_map.9 uvm_unmap.9 uvm_map.9 
 	uvm_map.9 uvmspace_exec.9 uvm_map.9 uvmspace_fork.9 \
 	uvm_map.9 uvmspace_free.9 uvm_map.9 uvmspace_share.9 \
 	uvm_map.9 uvmspace_unshare.9
+MLINKS+=uvm_obj_wirepages.9 uvm_obj_unwirepages.9
 
 MLINKS+=vme.9 vme_probe.9 \
 	vme.9 vme_space_map.9 \

Added files:

Index: src/share/man/man9/uvm_obj_wirepages.9
diff -u /dev/null src/share/man/man9/uvm_obj_wirepages.9:1.1
--- /dev/null	Fri Jun 14 13:19:35 2024
+++ src/share/man/man9/uvm_obj_wirepages.9	Fri Jun 14 13:19:35 2024
@@ -0,0 +1,90 @@
+.\"	$NetBSD: uvm_obj_wirepages.9,v 1.1 2024/06/14 13:19:35 riastradh Exp $
+.\"
+.\" Copyright (c) 2024 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd June 14, 2024
+.Dt UVM_OBJ_WIREPAGES 9
+.Os
+.Sh NAME
+.Nm uvm_obj_wirepages
+.Nm uvm_obj_unwirepages
+.Nd temporarily wire pages of a UVM object into RAM
+.Sh SYNOPSIS
+.In uvm/uvm_extern.h
+.Ft int
+.Fn uvm_obj_wirepages "struct uvm_object *uobj" "off_t start" "off_t end" "struct pglist *list"
+.Ft void
+.Fn uvm_obj_unwirepages "struct uvm_object *uobj" "off_t start" "off_t end"
+.Sh DESCRIPTION
+.Fn uvm_obj_wirepages
+temporarily wires a range of pages in a UVM object into RAM.
+If any pages from
+.Fa start
+(inclusive)
+to
+.Fa end
+(exclusive)
+are currently paged out, it pages them back in first, and arranges that
+the pages in the range will not be paged out until unwired with
+.Fn uvm_obj_unwirepages .
+.Pp
+If
+.Fa list
+is nonnull, it is initialized to a tailq of pages linked through the
+.Dv pageq.queue
+member of
+.Dt struct vm_page ,
+for the convenience of the caller.
+The caller is not transferred ownership of any part of
+.Fa list
+and need not free anything afterward \(em
+.Fn uvm_obj_unwirepages
+will free the pages when done.
+.Pp
+.Fa start
+and
+.Fa end
+must be page-aligned.
+.Pp
+Calls to
+.Fn uvm_obj_wirepages
+must be matched by
+.Fn uvm_obj_unwirepages
+with the same range.
+.Pp
+Overlapping ranges may be simultaneously wired; each page may be wired
+up to 2^32 - 1 times, and will not be paged out until all ranges
+covering it have been unwired.
+.Sh RETURN VALUES
+The
+.Fn uvm_obj_wirepages
+function returns zero on success, or returns an
+.Xr errno 3
+error code and leaves the wired status of all pages unchanged on
+failure.
+.Sh SEE ALSO
+.Xr mlock 3 ,
+.Xr uvm 9 ,
+.Xr uvm_map 9

Reply via email to