From c837e5bd114634ed3990684594e758b113e53336 Mon Sep 17 00:00:00 2001 From: alc Date: Sat, 28 Apr 2012 23:05:08 +0000 Subject: [PATCH] MFC r234038 If a page belonging a reservation is cached, then mark the reservation so that it will be freed to the cache pool rather than the default pool. Otherwise, the cached pages within the reservation may be recycled sooner than necessary. git-svn-id: svn://svn.freebsd.org/base/stable/8@234776 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/vm/vm_reserv.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/vm/vm_reserv.c b/sys/vm/vm_reserv.c index 39c205346..6b7ecad14 100644 --- a/sys/vm/vm_reserv.c +++ b/sys/vm/vm_reserv.c @@ -466,11 +466,13 @@ vm_reserv_free_page(vm_page_t m) mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); rv = vm_reserv_from_page(m); - if (rv->object != NULL) { - vm_reserv_depopulate(rv); - return (TRUE); - } - return (FALSE); + if (rv->object == NULL) + return (FALSE); + if ((m->flags & PG_CACHED) != 0 && m->pool != VM_FREEPOOL_CACHE) + vm_phys_set_pool(VM_FREEPOOL_CACHE, rv->pages, + VM_LEVEL_0_ORDER); + vm_reserv_depopulate(rv); + return (TRUE); } /* -- 2.45.0