kernel - Cleanup vm_page_repurpose()
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 17 Oct 2017 21:57:19 +0000 (14:57 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 17 Oct 2017 21:58:06 +0000 (14:58 -0700)
* Remove the now unused vm_page_repurpose() function.

* Remove emrunning variable.

sys/vm/vm_page.c
sys/vm/vm_page.h
sys/vm/vm_pageout.c

index aa6df20..af55397 100644 (file)
@@ -1356,80 +1356,6 @@ VM_PAGE_DEBUG_EXT(vm_page_lookup_busy_try)(struct vm_object *object,
        return m;
 }
 
-/*
- * Attempt to repurpose the passed-in page.  If the passed-in page cannot
- * be repurposed it will be released, *must_reenter will be set to 1, and
- * this function will fall-through to vm_page_lookup_busy_try().
- *
- * The passed-in page must be wired and not busy.  The returned page will
- * be busied and not wired.
- *
- * A different page may be returned.  The returned page will be busied and
- * not wired.
- *
- * NULL can be returned.  If so, the required page could not be busied.
- * The passed-in page will be unwired.
- */
-vm_page_t
-vm_page_repurpose(struct vm_object *object, vm_pindex_t pindex,
-                 int also_m_busy, int *errorp, vm_page_t m,
-                 int *must_reenter, int *iswired)
-{
-       if (m) {
-               /*
-                * Do not mess with pages in a complex state, such as pages
-                * which are mapped, as repurposing such pages can be more
-                * expensive than simply allocatin a new one.
-                *
-                * NOTE: Soft-busying can deadlock against putpages or I/O
-                *       so we only allow hard-busying here.
-                */
-               KKASSERT(also_m_busy == FALSE);
-               vm_page_busy_wait(m, also_m_busy, "biodep");
-
-               if ((m->flags & (PG_UNMANAGED | PG_MAPPED |
-                                PG_FICTITIOUS | PG_SBUSY)) ||
-                   m->busy || m->wire_count != 1 || m->hold_count) {
-                       vm_page_unwire(m, 0);
-                       vm_page_wakeup(m);
-                       /* fall through to normal lookup */
-               } else if (m->dirty || (m->flags & PG_NEED_COMMIT)) {
-                       vm_page_unwire(m, 0);
-                       vm_page_deactivate(m);
-                       vm_page_wakeup(m);
-                       /* fall through to normal lookup */
-               } else {
-                       /*
-                        * We can safely repurpose the page.  It should
-                        * already be unqueued.
-                        */
-                       KKASSERT(m->queue == PQ_NONE && m->dirty == 0);
-                       vm_page_remove(m);
-                       m->valid = 0;
-                       m->act_count = 0;
-                       if (vm_page_insert(m, object, pindex)) {
-                               *errorp = 0;
-                               *iswired = 1;
-
-                               return m;
-                       }
-                       vm_page_unwire(m, 0);
-                       vm_page_free(m);
-                       /* fall through to normal lookup */
-               }
-       }
-
-       /*
-        * Cannot repurpose page, attempt to locate the desired page.  May
-        * return NULL.
-        */
-       *must_reenter = 1;
-       *iswired = 0;
-       m = vm_page_lookup_busy_try(object, pindex, also_m_busy, errorp);
-
-       return m;
-}
-
 /*
  * Caller must hold the related vm_object
  */
index 3d06ef1..6b55d0b 100644 (file)
@@ -411,8 +411,6 @@ vm_page_t VM_PAGE_DEBUG_EXT(vm_page_lookup_busy_wait)(
 vm_page_t VM_PAGE_DEBUG_EXT(vm_page_lookup_busy_try)(
                struct vm_object *, vm_pindex_t, int, int *
                VM_PAGE_DEBUG_ARGS);
-vm_page_t vm_page_repurpose(struct vm_object *, vm_pindex_t, int, int *,
-               vm_page_t, int *, int *);
 void vm_page_remove (vm_page_t);
 void vm_page_rename (vm_page_t, struct vm_object *, vm_pindex_t);
 void vm_page_startup (void);
index a5f343e..7676c66 100644 (file)
@@ -1939,7 +1939,6 @@ vm_pageout_thread(void)
        int q1iterator = 0;
        int q2iterator = 0;
        int isep;
-       int emrunning;
 
        curthread->td_flags |= TDF_SYSTHREAD;
 
@@ -1947,7 +1946,6 @@ vm_pageout_thread(void)
         * We only need to setup once.
         */
        isep = 0;
-       emrunning = 0;
        if (curthread == emergpager) {
                isep = 1;
                goto skip_setup;
@@ -2086,13 +2084,9 @@ skip_setup:
                                continue;
                        }
                        if ((int)(ticks - vm_pagedaemon_time) < hz * 2) {
-                               if (emrunning)
-                                       emrunning = 0;
                                pass = 0;
                                continue;
                        }
-                       if (emrunning == 0)
-                               emrunning = 1;
                } else {
                        /*
                         * Primary pagedaemon