From owner-svn-src-head@FreeBSD.ORG Wed Aug 21 22:39:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 996E5BA1; Wed, 21 Aug 2013 22:39:20 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6C0E2239C; Wed, 21 Aug 2013 22:39:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7LMdKqo043769; Wed, 21 Aug 2013 22:39:20 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7LMdK96043768; Wed, 21 Aug 2013 22:39:20 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201308212239.r7LMdK96043768@svn.freebsd.org> From: Jeff Roberson Date: Wed, 21 Aug 2013 22:39:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254622 - 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: Wed, 21 Aug 2013 22:39:20 -0000 Author: jeff Date: Wed Aug 21 22:39:19 2013 New Revision: 254622 URL: http://svnweb.freebsd.org/changeset/base/254622 Log: - Eliminate the vm object lock from the active queue scan. It is not necessary since we do not free or cache the page from active anymore. Document the one possible race that is harmless. Sponsored by: EMC / Isilon Storage Division Discussed with: alc Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Wed Aug 21 22:37:15 2013 (r254621) +++ head/sys/vm/vm_pageout.c Wed Aug 21 22:39:19 2013 (r254622) @@ -1333,25 +1333,6 @@ relock_queues: m = next; continue; } - object = m->object; - if (!VM_OBJECT_TRYWLOCK(object) && - !vm_pageout_fallback_object_lock(m, &next)) { - VM_OBJECT_WUNLOCK(object); - vm_page_unlock(m); - m = next; - continue; - } - - /* - * Don't deactivate pages that are busy. - */ - if (vm_page_busied(m) || m->hold_count != 0) { - vm_page_unlock(m); - VM_OBJECT_WUNLOCK(object); - vm_page_requeue_locked(m); - m = next; - continue; - } /* * The count for pagedaemon pages is done after checking the @@ -1367,7 +1348,15 @@ relock_queues: vm_page_aflag_clear(m, PGA_REFERENCED); act_delta += 1; } - if (object->ref_count != 0) + /* + * Unlocked object ref count check. Two races are possible. + * 1) The ref was transitioning to zero and we saw non-zero, + * the pmap bits will be checked unnecessarily. + * 2) The ref was transitioning to one and we saw zero. + * The page lock prevents a new reference to this page so + * we need not check the reference bits. + */ + if (m->object->ref_count != 0) act_delta += pmap_ts_referenced(m); /* @@ -1387,9 +1376,6 @@ relock_queues: * queue depending on usage. */ if (act_delta == 0) { - KASSERT(object->ref_count != 0 || - !pmap_page_is_mapped(m), - ("vm_pageout_scan: page %p is mapped", m)); /* Dequeue to avoid later lock recursion. */ vm_page_dequeue_locked(m); vm_page_deactivate(m); @@ -1397,7 +1383,6 @@ relock_queues: } else vm_page_requeue_locked(m); vm_page_unlock(m); - VM_OBJECT_WUNLOCK(object); m = next; } vm_pagequeue_unlock(pq);