diff options
author | alc <alc@FreeBSD.org> | 2012-04-08 17:00:46 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2012-04-08 17:00:46 +0000 |
commit | a317fe06180234a9127f23f8f4839398ae2c71b5 (patch) | |
tree | 4071a7fab5a6690466bb3bdde26e7144e4361589 /sys/vm/vm_reserv.c | |
parent | 63d1a2cda8a26181b4a8a0004b374fe584c5f16f (diff) | |
download | FreeBSD-src-a317fe06180234a9127f23f8f4839398ae2c71b5.zip FreeBSD-src-a317fe06180234a9127f23f8f4839398ae2c71b5.tar.gz |
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.
Reported by: Andrey Zonov
Diffstat (limited to 'sys/vm/vm_reserv.c')
-rw-r--r-- | sys/vm/vm_reserv.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/vm/vm_reserv.c b/sys/vm/vm_reserv.c index 1450f8d..121e23a 100644 --- a/sys/vm/vm_reserv.c +++ b/sys/vm/vm_reserv.c @@ -652,11 +652,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); } /* |