summaryrefslogtreecommitdiffstats
path: root/sys/uvm/uvm_pmemrange.c
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2011-07-08 00:10:59 +0000
committertedu <tedu@openbsd.org>2011-07-08 00:10:59 +0000
commita640e527c2761034cdc99d20958c0b7126d06127 (patch)
tree342f47a6193fab6a0d0dc437210f0f09d580802f /sys/uvm/uvm_pmemrange.c
parentWhen reading dos labels use DOS_LABELSECTOR and don't use LABELOFFSET. For all these (diff)
downloadwireguard-openbsd-a640e527c2761034cdc99d20958c0b7126d06127.tar.xz
wireguard-openbsd-a640e527c2761034cdc99d20958c0b7126d06127.zip
some machines don't boot with the previous uvm reserve enforcement diff.
back it out.
Diffstat (limited to 'sys/uvm/uvm_pmemrange.c')
-rw-r--r--sys/uvm/uvm_pmemrange.c38
1 files changed, 1 insertions, 37 deletions
diff --git a/sys/uvm/uvm_pmemrange.c b/sys/uvm/uvm_pmemrange.c
index 20b68bd8152..a58f4fe8835 100644
--- a/sys/uvm/uvm_pmemrange.c
+++ b/sys/uvm/uvm_pmemrange.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_pmemrange.c,v 1.28 2011/07/07 20:52:50 oga Exp $ */
+/* $OpenBSD: uvm_pmemrange.c,v 1.29 2011/07/08 00:10:59 tedu Exp $ */
/*
* Copyright (c) 2009, 2010 Ariane van der Steldt <ariane@stack.nl>
@@ -20,7 +20,6 @@
#include <sys/systm.h>
#include <uvm/uvm.h>
#include <sys/malloc.h>
-#include <sys/mount.h> /* for BUFPAGES defines */
#include <sys/proc.h> /* XXX for atomic */
#include <sys/kernel.h>
@@ -748,7 +747,6 @@ uvm_pmr_getpages(psize_t count, paddr_t start, paddr_t end, paddr_t align,
int memtype; /* Requested memtype. */
int memtype_init; /* Best memtype. */
int desperate; /* True if allocation failed. */
- int is_pdaemon;
#ifdef DIAGNOSTIC
struct vm_page *diag_prev; /* Used during validation. */
#endif /* DIAGNOSTIC */
@@ -764,26 +762,6 @@ uvm_pmr_getpages(psize_t count, paddr_t start, paddr_t end, paddr_t align,
(boundary == 0 || maxseg * boundary >= count) &&
TAILQ_EMPTY(result));
- is_pdaemon = ((curproc == uvm.pagedaemon_proc) ||
- (curproc == syncerproc));
-
- /*
- * All allocations by the pagedaemon automatically get access to
- * the kernel reserve of pages so swapping can catch up with memory
- * exhaustion
- */
- if (is_pdaemon)
- flags |= UVM_PLA_USERESERVE;
-
- /*
- * check to see if we need to generate some free pages waking
- * the pagedaemon.
- */
- if ((uvmexp.free - BUFPAGES_DEFICIT) < uvmexp.freemin ||
- ((uvmexp.free - BUFPAGES_DEFICIT) < uvmexp.freetarg &&
- (uvmexp.inactive + BUFPAGES_INACT) < uvmexp.inactarg))
- wakeup(&uvm.pagedaemon);
-
/*
* TRYCONTIG is a noop if you only want a single segment.
* Remove it if that's the case: otherwise it'll deny the fast
@@ -858,20 +836,6 @@ retry: /* Return point after sleeping. */
fcount = 0;
fnsegs = 0;
- /*
- * fail if any of these conditions are true:
- * [1] there really are no free pages, or
- * [2] only kernel "reserved" pages remain and
- * the we are not allowed to use them.
- * [3] only pagedaemon "reserved" pages remain and
- * the requestor isn't the pagedaemon.
- */
- if (((uvmexp.free < uvmexp.reserve_kernel + ptoa(count)) &&
- (flags & UVM_PLA_USERESERVE) == 0) ||
- ((uvmexp.free < uvmexp.reserve_pagedaemon + ptoa(count)) &&
- !is_pdaemon))
- goto fail;
-
retry_desperate:
/*
* If we just want any page(s), go for the really fast option.