From owner-svn-src-all@FreeBSD.ORG Fri May 7 04:14:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 03095106567C; Fri, 7 May 2010 04:14:08 +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 E7B638FC1F; Fri, 7 May 2010 04:14:07 +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 o474E7p2084393; Fri, 7 May 2010 04:14:07 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o474E7tR084390; Fri, 7 May 2010 04:14:07 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201005070414.o474E7tR084390@svn.freebsd.org> From: Alan Cox Date: Fri, 7 May 2010 04:14:07 +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: r207738 - 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: Fri, 07 May 2010 04:14:08 -0000 Author: alc Date: Fri May 7 04:14:07 2010 New Revision: 207738 URL: http://svn.freebsd.org/changeset/base/207738 Log: Push down the page queues lock into vm_page_deactivate(). Eliminate an incorrect comment. Modified: head/sys/vm/vm_fault.c head/sys/vm/vm_page.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Fri May 7 04:04:24 2010 (r207737) +++ head/sys/vm/vm_fault.c Fri May 7 04:14:07 2010 (r207738) @@ -138,9 +138,7 @@ release_page(struct faultstate *fs) vm_page_wakeup(fs->m); vm_page_lock(fs->m); - vm_page_lock_queues(); vm_page_deactivate(fs->m); - vm_page_unlock_queues(); vm_page_unlock(fs->m); fs->m = NULL; } Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Fri May 7 04:04:24 2010 (r207737) +++ head/sys/vm/vm_page.c Fri May 7 04:14:07 2010 (r207738) @@ -1618,10 +1618,8 @@ vm_page_unwire(vm_page_t m, int activate } } - /* - * Move the specified page to the inactive queue. If the page has - * any associated swap, the swap is deallocated. + * Move the specified page to the inactive queue. * * Normally athead is 0 resulting in LRU operation. athead is set * to 1 if we want this page to be 'as if it were placed in the cache', @@ -1633,7 +1631,6 @@ static inline void _vm_page_deactivate(vm_page_t m, int athead) { - mtx_assert(&vm_page_queue_mtx, MA_OWNED); vm_page_lock_assert(m, MA_OWNED); /* @@ -1642,6 +1639,7 @@ _vm_page_deactivate(vm_page_t m, int ath if (VM_PAGE_INQUEUE2(m, PQ_INACTIVE)) return; if (m->wire_count == 0 && (m->flags & PG_UNMANAGED) == 0) { + vm_page_lock_queues(); vm_page_flag_clear(m, PG_WINATCFLS); vm_pageq_remove(m); if (athead) @@ -1650,13 +1648,20 @@ _vm_page_deactivate(vm_page_t m, int ath TAILQ_INSERT_TAIL(&vm_page_queues[PQ_INACTIVE].pl, m, pageq); VM_PAGE_SETQUEUE2(m, PQ_INACTIVE); cnt.v_inactive_count++; + vm_page_unlock_queues(); } } +/* + * Move the specified page to the inactive queue. + * + * The page must be locked. + */ void vm_page_deactivate(vm_page_t m) { - _vm_page_deactivate(m, 0); + + _vm_page_deactivate(m, 0); } /*