Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Jul 2018 17:41:49 +0000 (UTC)
From:      Alan Cox <alc@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r336984 - head/sys/vm
Message-ID:  <201807311741.w6VHfnu3030810@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: alc
Date: Tue Jul 31 17:41:48 2018
New Revision: 336984
URL: https://svnweb.freebsd.org/changeset/base/336984

Log:
  Allow vm object coalescing to occur in the midst of a vm object when the
  OBJ_ONEMAPPING flag is set.  In other words, allow recycling of existing
  but unused subranges of a vm object when the OBJ_ONEMAPPING flag is set.
  
  Such situations are increasingly common with jemalloc >= 5.0.  This
  change has the expected effect of reducing the number of vm map entry and
  object allocations and increasing the number of superpage promotions.
  
  Reviewed by:	kib, markj
  Tested by:	pho
  MFC after:	6 weeks
  Differential Revision:	https://reviews.freebsd.org/D16501

Modified:
  head/sys/vm/vm_object.c

Modified: head/sys/vm/vm_object.c
==============================================================================
--- head/sys/vm/vm_object.c	Tue Jul 31 17:18:58 2018	(r336983)
+++ head/sys/vm/vm_object.c	Tue Jul 31 17:41:48 2018	(r336984)
@@ -2142,8 +2142,9 @@ vm_object_coalesce(vm_object_t prev_object, vm_ooffset
 	next_size >>= PAGE_SHIFT;
 	next_pindex = OFF_TO_IDX(prev_offset) + prev_size;
 
-	if ((prev_object->ref_count > 1) &&
-	    (prev_object->size != next_pindex)) {
+	if (prev_object->ref_count > 1 &&
+	    prev_object->size != next_pindex &&
+	    (prev_object->flags & OBJ_ONEMAPPING) == 0) {
 		VM_OBJECT_WUNLOCK(prev_object);
 		return (FALSE);
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807311741.w6VHfnu3030810>