Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Aug 2015 20:30:28 +0000 (UTC)
From:      Alan Cox <alc@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r286255 - head/sys/vm
Message-ID:  <201508032030.t73KUScF094536@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 			}
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201508032030.t73KUScF094536>