by uvm_pglistalloc(9) does a similar check already.
ok mpi@
-/* $OpenBSD: uvm_swap.c,v 1.155 2022/04/28 09:58:11 mpi Exp $ */
+/* $OpenBSD: uvm_swap.c,v 1.156 2022/06/07 12:02:52 kettenis Exp $ */
/* $NetBSD: uvm_swap.c,v 1.40 2000/11/17 11:39:39 mrg Exp $ */
/*
{
struct pglist pgl;
int i;
- boolean_t fail;
-
- /* Estimate if we will succeed */
- uvm_lock_fpageq();
-
- fail = uvmexp.free - npages < uvmexp.reserve_kernel;
-
- uvm_unlock_fpageq();
-
- if (fail)
- return FALSE;
TAILQ_INIT(&pgl);
if (uvm_pglistalloc(npages * PAGE_SIZE, dma_constraint.ucr_low,