Call uvm_pageactivate() from uvm_pageunwire() instead of rerolling it.
authormpi <mpi@openbsd.org>
Thu, 28 Apr 2022 09:59:28 +0000 (09:59 +0000)
committermpi <mpi@openbsd.org>
Thu, 28 Apr 2022 09:59:28 +0000 (09:59 +0000)
Having fewer places manipulating the global list of active/inactive pages
will help future LRU improvements.

ok kettenis@, kn@

sys/uvm/uvm_page.c

index 3dd327d..7716597 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: uvm_page.c,v 1.163 2022/03/12 12:34:22 mpi Exp $      */
+/*     $OpenBSD: uvm_page.c,v 1.164 2022/04/28 09:59:28 mpi Exp $      */
 /*     $NetBSD: uvm_page.c,v 1.44 2000/11/27 08:40:04 chs Exp $        */
 
 /*
@@ -1279,9 +1279,7 @@ uvm_pageunwire(struct vm_page *pg)
 
        pg->wire_count--;
        if (pg->wire_count == 0) {
-               TAILQ_INSERT_TAIL(&uvm.page_active, pg, pageq);
-               uvmexp.active++;
-               atomic_setbits_int(&pg->pg_flags, PQ_ACTIVE);
+               uvm_pageactivate(pg);
                uvmexp.wired--;
        }
 }