From owner-svn-src-head@FreeBSD.ORG Mon Mar 4 13:11:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1C1826B6; Mon, 4 Mar 2013 13:11:00 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E57121798; Mon, 4 Mar 2013 13:10:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r24DAxD7061142; Mon, 4 Mar 2013 13:10:59 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r24DAxau061141; Mon, 4 Mar 2013 13:10:59 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201303041310.r24DAxau061141@svn.freebsd.org> From: Attilio Rao Date: Mon, 4 Mar 2013 13:10:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247788 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Mar 2013 13:11:00 -0000 Author: attilio Date: Mon Mar 4 13:10:59 2013 New Revision: 247788 URL: http://svnweb.freebsd.org/changeset/base/247788 Log: Merge from vmcontention: As vm objects are type-stable there is no need to initialize the resident splay tree pointer and the cache splay tree pointer in _vm_object_allocate() but this could be done in the init UMA zone handler. The destructor UMA zone handler, will further check if the condition is retained at every destruction and catch for bugs. Sponsored by: EMC / Isilon storage division Submitted by: alc Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Mon Mar 4 12:48:41 2013 (r247787) +++ head/sys/vm/vm_object.c Mon Mar 4 13:10:59 2013 (r247788) @@ -165,8 +165,9 @@ vm_object_zdtor(void *mem, int size, voi object = (vm_object_t)mem; KASSERT(TAILQ_EMPTY(&object->memq), - ("object %p has resident pages", - object)); + ("object %p has resident pages in its memq", object)); + KASSERT(object->root == NULL, + ("object %p has resident pages in its tree", object)); #if VM_NRESERVLEVEL > 0 KASSERT(LIST_EMPTY(&object->rvq), ("object %p has reservations", @@ -197,9 +198,11 @@ vm_object_zinit(void *mem, int size, int mtx_init(&object->mtx, "vm object", NULL, MTX_DEF | MTX_DUPOK); /* These are true for any object that has been freed */ + object->root = NULL; object->paging_in_progress = 0; object->resident_page_count = 0; object->shadow_count = 0; + object->cache = NULL; return (0); } @@ -210,7 +213,6 @@ _vm_object_allocate(objtype_t type, vm_p TAILQ_INIT(&object->memq); LIST_INIT(&object->shadow_head); - object->root = NULL; object->type = type; switch (type) { case OBJT_DEAD: @@ -247,7 +249,6 @@ _vm_object_allocate(objtype_t type, vm_p #if VM_NRESERVLEVEL > 0 LIST_INIT(&object->rvq); #endif - object->cache = NULL; mtx_lock(&vm_object_list_mtx); TAILQ_INSERT_TAIL(&vm_object_list, object, object_list);