aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/vm/vm_object.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index e5f26cb36669..60ede1d397c5 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -1693,7 +1693,9 @@ vm_object_collapse(vm_object_t object)
* If we do not entirely shadow the backing object,
* there is nothing we can do so we give up.
*/
- if (vm_object_backing_scan(object, OBSC_TEST_ALL_SHADOWED) == 0) {
+ if (object->resident_page_count != object->size &&
+ vm_object_backing_scan(object,
+ OBSC_TEST_ALL_SHADOWED) == 0) {
VM_OBJECT_UNLOCK(backing_object);
break;
}