Index | Thread | Search

From:
Martin Pieuchot <mpi@grenadille.net>
Subject:
Page reserves
To:
tech@openbsd.org
Cc:
tb@openbsd.org
Date:
Mon, 25 Nov 2024 14:44:05 +0100

Download raw body.

Thread
  • Martin Pieuchot:

    Page reserves

Diff below removes unused 'min' values and indicates that the reserve
for the kernel includes the one for the page daemon.

While here add a comment to document that reserving 'high' memory for
the page daemon is not helping.

No change in behavior.

ok?

Index: uvm/uvm_meter.c
===================================================================
RCS file: /cvs/src/sys/uvm/uvm_meter.c,v
diff -u -p -r1.50 uvm_meter.c
--- uvm/uvm_meter.c	16 Sep 2023 09:33:27 -0000	1.50
+++ uvm/uvm_meter.c	9 Nov 2024 12:37:11 -0000
@@ -301,9 +301,6 @@ uvmexp_print(int (*pr)(const char *, ...
 	(*pr)("  %d VM pages: %d active, %d inactive, %d wired, %d free (%d zero)\n",
 	    uexp.npages, uexp.active, uexp.inactive, uexp.wired,
 	    uexp.free, uexp.zeropages);
-	(*pr)("  min  %d%% (%d) anon, %d%% (%d) vnode, %d%% (%d) vtext\n",
-	    uexp.anonminpct, uexp.anonmin, uexp.vnodeminpct,
-	    uexp.vnodemin, uexp.vtextminpct, uexp.vtextmin);
 	(*pr)("  freemin=%d, free-target=%d, inactive-target=%d, "
 	    "wired-max=%d\n", uexp.freemin, uexp.freetarg, uexp.inactarg,
 	    uexp.wiredmax);
Index: uvm/uvm_page.c
===================================================================
RCS file: /cvs/src/sys/uvm/uvm_page.c,v
diff -u -p -r1.177 uvm_page.c
--- uvm/uvm_page.c	1 May 2024 12:54:27 -0000	1.177
+++ uvm/uvm_page.c	9 Nov 2024 12:43:21 -0000
@@ -279,17 +279,16 @@ uvm_page_init(vaddr_t *kvm_startp, vaddr
 	mtx_init(&uvm.aiodoned_lock, IPL_BIO);
 
 	/*
-	 * init reserve thresholds
-	 * XXXCDC - values may need adjusting
+	 * init reserve thresholds.
+	 *
+	 * XXX As long as some disk drivers cannot write any physical
+	 * XXX page, we need DMA reachable reserves for the pagedaemon.
+	 * XXX We cannot enforce such requirement but it should be ok
+	 * XXX in most of the cases because the pmemrange tries hard to
+	 * XXX allocate them last.
 	 */
-	uvmexp.reserve_pagedaemon = 4;
-	uvmexp.reserve_kernel = 8;
-	uvmexp.anonminpct = 10;
-	uvmexp.vnodeminpct = 10;
-	uvmexp.vtextminpct = 5;
-	uvmexp.anonmin = uvmexp.anonminpct * 256 / 100;
-	uvmexp.vnodemin = uvmexp.vnodeminpct * 256 / 100;
-	uvmexp.vtextmin = uvmexp.vtextminpct * 256 / 100;
+	uvmexp.reserve_pagedaemon = SWCLUSTPAGES + 4;
+	uvmexp.reserve_kernel = uvmexp.reserve_pagedaemon + 4;
 
 	uvm.page_init_done = TRUE;
 }