From 0e79619e1e7e13bbc26a56a9c540c2adf96f9ebf Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Sat, 7 Sep 2019 16:01:45 +0000 Subject: [PATCH] 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 --- sys/vm/vm_object.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index b92da204cd16..6971f82c3f40 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -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 ||