Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Sep 2019 16:01:46 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r352014 - head/sys/vm
Message-ID:  <201909071601.x87G1kKb002021@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Sat Sep  7 16:01:45 2019
New Revision: 352014
URL: https://svnweb.freebsd.org/changeset/base/352014

Log:
  vm_object_deallocate(): Remove no longer needed code.
  
  We track text mappings explicitly, there is no removal of the text
  refs on the object deallocate any more, so tmpfs objects should not be
  treated specially. Doing so causes excess deref.
  
  Reported and tested by:	gallatin
  Reviewed by:	markj
  MFC after:	1 week
  Differential revision:	https://reviews.freebsd.org/D21560

Modified:
  head/sys/vm/vm_object.c

Modified: head/sys/vm/vm_object.c
==============================================================================
--- head/sys/vm/vm_object.c	Sat Sep  7 15:58:48 2019	(r352013)
+++ head/sys/vm/vm_object.c	Sat Sep  7 16:01:45 2019	(r352014)
@@ -508,7 +508,6 @@ void
 vm_object_deallocate(vm_object_t object)
 {
 	vm_object_t temp;
-	struct vnode *vp;
 
 	while (object != NULL) {
 		VM_OBJECT_WLOCK(object);
@@ -531,25 +530,6 @@ vm_object_deallocate(vm_object_t object)
 			VM_OBJECT_WUNLOCK(object);
 			return;
 		} else if (object->ref_count == 1) {
-			if (object->type == OBJT_SWAP &&
-			    (object->flags & OBJ_TMPFS) != 0) {
-				vp = object->un_pager.swp.swp_tmpfs;
-				vhold(vp);
-				VM_OBJECT_WUNLOCK(object);
-				vn_lock(vp, LK_SHARED | LK_RETRY);
-				VM_OBJECT_WLOCK(object);
-				if (object->type == OBJT_DEAD ||
-				    object->ref_count != 1) {
-					VM_OBJECT_WUNLOCK(object);
-					VOP_UNLOCK(vp, 0);
-					vdrop(vp);
-					return;
-				}
-				if ((object->flags & OBJ_TMPFS) != 0)
-					VOP_UNSET_TEXT(vp);
-				VOP_UNLOCK(vp, 0);
-				vdrop(vp);
-			}
 			if (object->shadow_count == 0 &&
 			    object->handle == NULL &&
 			    (object->type == OBJT_DEFAULT ||



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