From: mpi Date: Wed, 2 Oct 2024 10:24:11 +0000 (+0000) Subject: Improve responsiveness in OOM situations & make free target checks coherent. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=7d378e625ce36c9ed7a885a94109e111b6281c9e;p=openbsd Improve responsiveness in OOM situations & make free target checks coherent. Remove a change introduced in NetBSD to pageout 4 times as many pages as required to meet the low water mark of free pages. With todays' Gbs of RAMs, it makes the pagedaemon hog the CPU for too long when the amount of free pages is close to none. ok sthen@, kettenis@ --- diff --git a/sys/uvm/uvm_pdaemon.c b/sys/uvm/uvm_pdaemon.c index be32a5ab635..973b4acec88 100644 --- a/sys/uvm/uvm_pdaemon.c +++ b/sys/uvm/uvm_pdaemon.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_pdaemon.c,v 1.115 2024/09/30 08:09:39 mpi Exp $ */ +/* $OpenBSD: uvm_pdaemon.c,v 1.116 2024/10/02 10:24:11 mpi Exp $ */ /* $NetBSD: uvm_pdaemon.c,v 1.23 2000/08/20 10:24:14 bjh21 Exp $ */ /* @@ -468,7 +468,7 @@ uvmpd_scan_inactive(struct uvm_pmalloc *pma, */ free = uvmexp.free - BUFPAGES_DEFICIT; if (((pma == NULL || (pma->pm_flags & UVM_PMA_FREED)) && - (free + uvmexp.paging >= uvmexp.freetarg << 2)) || + (free + uvmexp.paging >= uvmexp.freetarg)) || dirtyreacts == UVMPD_NUMDIRTYREACTS) { if (swslot == 0) { /* exit now if no swap-i/o pending */ @@ -565,7 +565,7 @@ uvmpd_scan_inactive(struct uvm_pmalloc *pma, * free target when all the current pageouts complete. */ if ((pma == NULL || (pma->pm_flags & UVM_PMA_FREED)) && - (free + uvmexp.paging > uvmexp.freetarg << 2)) { + (free + uvmexp.paging > uvmexp.freetarg)) { rw_exit(slock); continue; }