From owner-svn-src-all@FreeBSD.ORG Sun Jan 30 23:55:48 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A777C1065670; Sun, 30 Jan 2011 23:55:48 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 983E38FC08; Sun, 30 Jan 2011 23:55:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0UNtmpQ090457; Sun, 30 Jan 2011 23:55:48 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0UNtm9G090455; Sun, 30 Jan 2011 23:55:48 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201101302355.p0UNtm9G090455@svn.freebsd.org> From: Alan Cox Date: Sun, 30 Jan 2011 23:55:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218113 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jan 2011 23:55:48 -0000 Author: alc Date: Sun Jan 30 23:55:48 2011 New Revision: 218113 URL: http://svn.freebsd.org/changeset/base/218113 Log: Release the free page queues lock earlier in vm_page_alloc(). Discussed with: kib@ Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sun Jan 30 23:29:45 2011 (r218112) +++ head/sys/vm/vm_page.c Sun Jan 30 23:55:48 2011 (r218113) @@ -1318,7 +1318,8 @@ vm_page_alloc(vm_object_t object, vm_pin } /* - * Initialize structure. Only the PG_ZERO flag is inherited. + * Only the PG_ZERO flag is inherited. The PG_CACHED or PG_FREE flag + * must be cleared before the free page queues lock is released. */ flags = 0; if (m->flags & PG_ZERO) { @@ -1329,15 +1330,19 @@ vm_page_alloc(vm_object_t object, vm_pin if (object == NULL || object->type == OBJT_PHYS) flags |= PG_UNMANAGED; m->flags = flags; + mtx_unlock(&vm_page_queue_free_mtx); if (req & (VM_ALLOC_NOBUSY | VM_ALLOC_NOOBJ)) m->oflags = 0; else m->oflags = VPO_BUSY; if (req & VM_ALLOC_WIRED) { + /* + * The page lock is not required for wiring a page until that + * page is inserted into the object. + */ atomic_add_int(&cnt.v_wire_count, 1); m->wire_count = 1; } - mtx_unlock(&vm_page_queue_free_mtx); m->act_count = 0; if (object != NULL) {