summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2011-12-28 20:27:18 +0000
committeralc <alc@FreeBSD.org>2011-12-28 20:27:18 +0000
commit7f817ed8c542dc264f729d233e3fd1f65675132b (patch)
treef84f890b7c9e6e4bb871de7a1d7fb488f1ef9437 /sys/vm
parentd8353bd3a28f2633bf8daa3ef31a9b40f200d1f1 (diff)
downloadFreeBSD-src-7f817ed8c542dc264f729d233e3fd1f65675132b.zip
FreeBSD-src-7f817ed8c542dc264f729d233e3fd1f65675132b.tar.gz
Optimize vm_object_split()'s handling of reservations.
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_object.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index a9de554..716916f 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -1323,6 +1323,21 @@ retry:
VM_OBJECT_LOCK(new_object);
goto retry;
}
+#if VM_NRESERVLEVEL > 0
+ /*
+ * If some of the reservation's allocated pages remain with
+ * the original object, then transferring the reservation to
+ * the new object is neither particularly beneficial nor
+ * particularly harmful as compared to leaving the reservation
+ * with the original object. If, however, all of the
+ * reservation's allocated pages are transferred to the new
+ * object, then transferring the reservation is typically
+ * beneficial. Determining which of these two cases applies
+ * would be more costly than unconditionally renaming the
+ * reservation.
+ */
+ vm_reserv_rename(m, new_object, orig_object, offidxstart);
+#endif
vm_page_lock(m);
vm_page_rename(m, new_object, idx);
vm_page_unlock(m);
OpenPOWER on IntegriCloud