From 510382f31198ad0efd3fa319e4aaecca208ab347 Mon Sep 17 00:00:00 2001 From: alc Date: Wed, 28 Dec 2011 20:27:18 +0000 Subject: [PATCH 60/65] Optimize vm_object_split()'s handling of reservations. git-svn-id: http://svn.freebsd.org/base/head@228936 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f (cherry picked from commit d952329af606694a2aa8cc64669d50c4647cc3b4) Signed-off-by: Xin Li --- sys/vm/vm_object.c | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 70003e3..0650c7f 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -1330,6 +1330,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); -- 1.7.8.3