From: kettenis Date: Thu, 2 Jun 2022 18:00:53 +0000 (+0000) Subject: Take the size of allocation into account when checking the kernel reserve. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b7757c6ebbc9b4d8edce4af8a2a2396996d06f1c;p=openbsd Take the size of allocation into account when checking the kernel reserve. ok mpi@ --- diff --git a/sys/uvm/uvm_pmemrange.c b/sys/uvm/uvm_pmemrange.c index 3e33efdf6d5..7a659efc4bf 100644 --- a/sys/uvm/uvm_pmemrange.c +++ b/sys/uvm/uvm_pmemrange.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_pmemrange.c,v 1.61 2021/03/12 14:15:49 jsg Exp $ */ +/* $OpenBSD: uvm_pmemrange.c,v 1.62 2022/06/02 18:00:53 kettenis Exp $ */ /* * Copyright (c) 2009, 2010 Ariane van der Steldt @@ -959,7 +959,7 @@ again: * [3] only pagedaemon "reserved" pages remain and * the requestor isn't the pagedaemon nor the syncer. */ - if ((uvmexp.free <= uvmexp.reserve_kernel) && + if ((uvmexp.free <= (uvmexp.reserve_kernel + count)) && !(flags & UVM_PLA_USERESERVE)) { uvm_unlock_fpageq(); return ENOMEM;