summaryrefslogtreecommitdiff
path: root/sys/uvm
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2024-11-06 10:41:13 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2024-11-06 10:41:13 +0000
commitb90352ab8f9ead864083db57414442d3728907cf (patch)
tree95634eb16671a835c73bfc6f805e8b4b25ed462b /sys/uvm
parent713ea9e2dee179dc2bd48ec7d0c07ff7d4d10e59 (diff)
Re-check limits after being awoken to ensure page daemon reserves aren't stolen.
ok miod@, kettenis@
Diffstat (limited to 'sys/uvm')
-rw-r--r--sys/uvm/uvm_pmemrange.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/uvm/uvm_pmemrange.c b/sys/uvm/uvm_pmemrange.c
index 0e9aa8dc64e..287308db735 100644
--- a/sys/uvm/uvm_pmemrange.c
+++ b/sys/uvm/uvm_pmemrange.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_pmemrange.c,v 1.72 2024/11/05 18:35:14 mpi Exp $ */
+/* $OpenBSD: uvm_pmemrange.c,v 1.73 2024/11/06 10:41:12 mpi Exp $ */
/*
* Copyright (c) 2024 Martin Pieuchot <mpi@openbsd.org>
@@ -955,9 +955,8 @@ uvm_pmr_getpages(psize_t count, paddr_t start, paddr_t end, paddr_t align,
*/
desperate = 0;
-again:
uvm_lock_fpageq();
-
+retry: /* Return point after sleeping. */
/*
* check to see if we need to generate some free pages waking
* the pagedaemon.
@@ -986,12 +985,12 @@ again:
uvm_unlock_fpageq();
if (flags & UVM_PLA_WAITOK) {
uvm_wait("uvm_pmr_getpages");
- goto again;
+ uvm_lock_fpageq();
+ goto retry;
}
return ENOMEM;
}
-retry: /* Return point after sleeping. */
fcount = 0;
fnsegs = 0;