diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2022-05-12 12:49:32 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2022-05-12 12:49:32 +0000 |
commit | 5e7a702b0cdbfdb41381d5bcb38843761673804c (patch) | |
tree | ec13b6a5e340f3747d951e1af2272b82bd9767b4 /sys/uvm/uvm_pdaemon.c | |
parent | 5222bea1bea6c8a480e3f3a8fcc887f9841ba4f3 (diff) |
Consider BUFPAGES_DEFICIT in swap_shortage.
ok beck@
Diffstat (limited to 'sys/uvm/uvm_pdaemon.c')
-rw-r--r-- | sys/uvm/uvm_pdaemon.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/uvm/uvm_pdaemon.c b/sys/uvm/uvm_pdaemon.c index f2ab57068be..5d66cbdbc57 100644 --- a/sys/uvm/uvm_pdaemon.c +++ b/sys/uvm/uvm_pdaemon.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_pdaemon.c,v 1.98 2022/05/04 14:58:26 mpi Exp $ */ +/* $OpenBSD: uvm_pdaemon.c,v 1.99 2022/05/12 12:49:31 mpi Exp $ */ /* $NetBSD: uvm_pdaemon.c,v 1.23 2000/08/20 10:24:14 bjh21 Exp $ */ /* @@ -923,12 +923,13 @@ uvmpd_scan(void) * detect if we're not going to be able to page anything out * until we free some swap resources from active pages. */ + free = uvmexp.free - BUFPAGES_DEFICIT; swap_shortage = 0; - if (uvmexp.free < uvmexp.freetarg && + if (free < uvmexp.freetarg && uvmexp.swpginuse == uvmexp.swpages && !uvm_swapisfull() && pages_freed == 0) { - swap_shortage = uvmexp.freetarg - uvmexp.free; + swap_shortage = uvmexp.freetarg - free; } for (p = TAILQ_FIRST(&uvm.page_active); |