diff options
author | kib <kib@FreeBSD.org> | 2017-09-22 10:45:51 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2017-09-22 10:45:51 +0000 |
commit | 087a58346e893fdf785d5c31508529966661a596 (patch) | |
tree | 5c82321e0dcfe658ea288863dffbbdd58e88ba87 | |
parent | a0615d814ccd8842467cff7949339ae4f12505c4 (diff) | |
download | FreeBSD-src-087a58346e893fdf785d5c31508529966661a596.zip FreeBSD-src-087a58346e893fdf785d5c31508529966661a596.tar.gz |
MFC r323616:
Batch freeing of the pages in vm_object_page_remove().
-rw-r--r-- | sys/vm/vm_object.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 066798c..3542b9c 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -1960,6 +1960,7 @@ vm_object_page_remove(vm_object_t object, vm_pindex_t start, vm_pindex_t end, { vm_page_t p, next; struct mtx *mtx; + struct pglist pgl; VM_OBJECT_ASSERT_WLOCKED(object); KASSERT((object->flags & OBJ_UNMANAGED) == 0 || @@ -1968,6 +1969,7 @@ vm_object_page_remove(vm_object_t object, vm_pindex_t start, vm_pindex_t end, if (object->resident_page_count == 0) return; vm_object_pip_add(object, 1); + TAILQ_INIT(&pgl); again: p = vm_page_find_least(object, start); mtx = NULL; @@ -2019,10 +2021,13 @@ again: } if ((options & OBJPR_NOTMAPPED) == 0) pmap_remove_all(p); - vm_page_free(p); + p->flags &= ~PG_ZERO; + if (vm_page_free_prep(p, false)) + TAILQ_INSERT_TAIL(&pgl, p, listq); } if (mtx != NULL) mtx_unlock(mtx); + vm_page_free_phys_pglist(&pgl); vm_object_pip_wakeup(object); } |