From owner-svn-src-head@FreeBSD.ORG Mon May 3 16:55:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 30ABA106566C; Mon, 3 May 2010 16:55:51 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 20DB78FC29; Mon, 3 May 2010 16:55:51 +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 o43GtpVX037714; Mon, 3 May 2010 16:55:51 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o43GtoYK037710; Mon, 3 May 2010 16:55:50 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201005031655.o43GtoYK037710@svn.freebsd.org> From: Alan Cox Date: Mon, 3 May 2010 16:55:50 +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: r207574 - in head/sys/dev: agp drm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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, 03 May 2010 16:55:51 -0000 Author: alc Date: Mon May 3 16:55:50 2010 New Revision: 207574 URL: http://svn.freebsd.org/changeset/base/207574 Log: Acquire the page lock around vm_page_unwire(). For consistency, extend the scope of the object lock in agp_i810.c. (In this specific case, the scope of the object lock shouldn't matter, but I don't want to create a bad example that might be copied to a case where it did matter.) Reviewed by: kib Modified: head/sys/dev/agp/agp.c head/sys/dev/agp/agp_i810.c head/sys/dev/drm/via_dmablit.c Modified: head/sys/dev/agp/agp.c ============================================================================== --- head/sys/dev/agp/agp.c Mon May 3 16:41:11 2010 (r207573) +++ head/sys/dev/agp/agp.c Mon May 3 16:55:50 2010 (r207574) @@ -623,9 +623,11 @@ bad: m = vm_page_lookup(mem->am_obj, OFF_TO_IDX(k)); if (k >= i) vm_page_wakeup(m); + vm_page_lock(m); vm_page_lock_queues(); vm_page_unwire(m, 0); vm_page_unlock_queues(); + vm_page_unlock(m); } VM_OBJECT_UNLOCK(mem->am_obj); @@ -657,9 +659,11 @@ agp_generic_unbind_memory(device_t dev, VM_OBJECT_LOCK(mem->am_obj); for (i = 0; i < mem->am_size; i += PAGE_SIZE) { m = vm_page_lookup(mem->am_obj, atop(i)); + vm_page_lock(m); vm_page_lock_queues(); vm_page_unwire(m, 0); vm_page_unlock_queues(); + vm_page_unlock(m); } VM_OBJECT_UNLOCK(mem->am_obj); Modified: head/sys/dev/agp/agp_i810.c ============================================================================== --- head/sys/dev/agp/agp_i810.c Mon May 3 16:41:11 2010 (r207573) +++ head/sys/dev/agp/agp_i810.c Mon May 3 16:55:50 2010 (r207574) @@ -1010,10 +1010,12 @@ agp_i810_free_memory(device_t dev, struc VM_OBJECT_LOCK(mem->am_obj); m = vm_page_lookup(mem->am_obj, 0); - VM_OBJECT_UNLOCK(mem->am_obj); + vm_page_lock(m); vm_page_lock_queues(); vm_page_unwire(m, 0); vm_page_unlock_queues(); + vm_page_unlock(m); + VM_OBJECT_UNLOCK(mem->am_obj); } else { contigfree(sc->argb_cursor, mem->am_size, M_AGP); sc->argb_cursor = NULL; Modified: head/sys/dev/drm/via_dmablit.c ============================================================================== --- head/sys/dev/drm/via_dmablit.c Mon May 3 16:41:11 2010 (r207573) +++ head/sys/dev/drm/via_dmablit.c Mon May 3 16:55:50 2010 (r207574) @@ -178,9 +178,11 @@ via_free_sg_info(drm_via_sg_info_t *vsg) case dr_via_pages_locked: for (i=0; i < vsg->num_pages; ++i) { if ( NULL != (page = vsg->pages[i])) { + vm_page_lock(page); vm_page_lock_queues(); vm_page_unwire(page, 0); vm_page_unlock_queues(); + vm_page_unlock(page); } } case dr_via_pages_alloc: