From owner-svn-src-head@freebsd.org Mon Aug 3 20:30:28 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA4439B2BA8; Mon, 3 Aug 2015 20:30:28 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B6BC16D5; Mon, 3 Aug 2015 20:30:28 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t73KUSNu094537; Mon, 3 Aug 2015 20:30:28 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t73KUScF094536; Mon, 3 Aug 2015 20:30:28 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201508032030.t73KUScF094536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Mon, 3 Aug 2015 20:30:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286255 - 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.20 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 Aug 2015 20:30:28 -0000 Author: alc Date: Mon Aug 3 20:30:27 2015 New Revision: 286255 URL: https://svnweb.freebsd.org/changeset/base/286255 Log: Refinements to r281079's sequential access optimization: Prefetched pages, which constitute the majority of the pages that are processed by vm_fault_dontneed(), are already near the tail of the inactive queue. Only the pages at faulting virtual addresses are actually moved by vm_page_advise(..., MADV_DONTNEED). However, vm_page_advise(..., MADV_DONTNEED) is simultaneously too aggressive and passive for the moved pages. It makes most of these pages too easily reclaimable, and at the same time it leaves enough pages in the active queue to trigger pageouts by the page daemon. Instead, with this change, the pages at faulting virtual addresses are moved to the tail of the inactive queue, where they are relatively close to the pages prefetched by the same page fault. Discussed with: jeff Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Mon Aug 3 19:15:19 2015 (r286254) +++ head/sys/vm/vm_fault.c Mon Aug 3 20:30:27 2015 (r286255) @@ -1081,9 +1081,19 @@ vm_fault_dontneed(const struct faultstat if (m->valid != VM_PAGE_BITS_ALL || vm_page_busied(m)) continue; + + /* + * Don't clear PGA_REFERENCED, since it would + * likely represent a reference by a different + * process. + * + * Typically, at this point, prefetched pages + * are still in the inactive queue. Only + * pages that triggered page faults are in the + * active queue. + */ vm_page_lock(m); - if (m->hold_count == 0 && m->wire_count == 0) - vm_page_advise(m, MADV_DONTNEED); + vm_page_deactivate(m); vm_page_unlock(m); } }