Remove redundant check for free pages. The pmemrange code that is called
authorkettenis <kettenis@openbsd.org>
Tue, 7 Jun 2022 12:02:52 +0000 (12:02 +0000)
committerkettenis <kettenis@openbsd.org>
Tue, 7 Jun 2022 12:02:52 +0000 (12:02 +0000)
by uvm_pglistalloc(9) does a similar check already.

ok mpi@

sys/uvm/uvm_swap.c

index d49969c..03914c1 100644 (file)
@@ -1,4 +1,4 @@
-/*     $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 $        */
 
 /*
@@ -328,17 +328,6 @@ uvm_swap_allocpages(struct vm_page **pps, int npages)
 {
        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,