From e72711219a3245468b41bb660d187f9e798da38d Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Tue, 17 Oct 2017 14:57:19 -0700 Subject: [PATCH] kernel - Cleanup vm_page_repurpose() * Remove the now unused vm_page_repurpose() function. * Remove emrunning variable. --- sys/vm/vm_page.c | 74 --------------------------------------------- sys/vm/vm_page.h | 2 -- sys/vm/vm_pageout.c | 6 ---- 3 files changed, 82 deletions(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index aa6df20c10..af55397ebf 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -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 */ diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index 3d06ef1e7b..6b55d0b682 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -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); diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index a5f343e74a..7676c66a17 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -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 -- 2.41.0