From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 16:18:45 2010 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 AFB70106564A; Thu, 29 Apr 2010 16:18:45 +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 8523F8FC08; Thu, 29 Apr 2010 16:18:45 +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 o3TGIj3Q094709; Thu, 29 Apr 2010 16:18:45 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3TGIjjo094707; Thu, 29 Apr 2010 16:18:45 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201004291618.o3TGIjjo094707@svn.freebsd.org> From: Alan Cox Date: Thu, 29 Apr 2010 16:18:45 +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: r207374 - 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: Thu, 29 Apr 2010 16:18:45 -0000 Author: alc Date: Thu Apr 29 16:18:45 2010 New Revision: 207374 URL: http://svn.freebsd.org/changeset/base/207374 Log: Simplify the inner loop of vm_pageout_object_deactivate_pages(). Rather than checking each page for PG_UNMANAGED, check the vm object's type. Only OBJT_PHYS can have unmanaged pages. Eliminate a pointless counter. The vm object is locked, that lock is never released by the inner loop, and the set of pages contained by the vm object is not changed by the inner loop. Therefore, the counter serves no purpose. Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Thu Apr 29 15:47:31 2010 (r207373) +++ head/sys/vm/vm_pageout.c Thu Apr 29 16:18:45 2010 (r207374) @@ -508,17 +508,16 @@ vm_pageout_object_deactivate_pages(pmap, { vm_object_t backing_object, object; vm_page_t p, next; - int actcount, rcount, remove_mode; + int actcount, remove_mode; VM_OBJECT_LOCK_ASSERT(first_object, MA_OWNED); if (first_object->type == OBJT_DEVICE || - first_object->type == OBJT_SG || - first_object->type == OBJT_PHYS) + first_object->type == OBJT_SG) return; for (object = first_object;; object = backing_object) { if (pmap_resident_count(pmap) <= desired) goto unlock_return; - if (object->paging_in_progress) + if (object->type == OBJT_PHYS || object->paging_in_progress) goto unlock_return; remove_mode = 0; @@ -527,10 +526,9 @@ vm_pageout_object_deactivate_pages(pmap, /* * scan the objects entire memory queue */ - rcount = object->resident_page_count; p = TAILQ_FIRST(&object->memq); vm_page_lock_queues(); - while (p && (rcount-- > 0)) { + while (p != NULL) { if (pmap_resident_count(pmap) <= desired) { vm_page_unlock_queues(); goto unlock_return; @@ -541,7 +539,6 @@ vm_pageout_object_deactivate_pages(pmap, p->hold_count != 0 || p->busy != 0 || (p->oflags & VPO_BUSY) || - (p->flags & PG_UNMANAGED) || !pmap_page_exists_quick(pmap, p)) { p = next; continue;