svn commit: r306908 - user/alc/PQ_LAUNDRY/sys/vm

Alan Cox alc at FreeBSD.org
Sun Oct 9 18:39:14 UTC 2016


Author: alc
Date: Sun Oct  9 18:39:13 2016
New Revision: 306908
URL: https://svnweb.freebsd.org/changeset/base/306908

Log:
  By the time that we've laundered a page, it has gone unreferenced for a
  long time, especially if it was background laundered.  So, it makes more
  sense to place the page nearer the head of the inactive queue than the
  tail.
  
  Reviewed by:	markj

Modified:
  user/alc/PQ_LAUNDRY/sys/vm/swap_pager.c

Modified: user/alc/PQ_LAUNDRY/sys/vm/swap_pager.c
==============================================================================
--- user/alc/PQ_LAUNDRY/sys/vm/swap_pager.c	Sun Oct  9 13:59:38 2016	(r306907)
+++ user/alc/PQ_LAUNDRY/sys/vm/swap_pager.c	Sun Oct  9 18:39:13 2016	(r306908)
@@ -1549,13 +1549,16 @@ swp_pager_async_iodone(struct buf *bp)
 			 * For write success, clear the dirty
 			 * status, then finish the I/O ( which decrements the
 			 * busy count and possibly wakes waiter's up ).
+			 * A page is only written to swap after a period of
+			 * inactivity.  Therefore, we do not expect it to be
+			 * reused.
 			 */
 			KASSERT(!pmap_page_is_write_mapped(m),
 			    ("swp_pager_async_iodone: page %p is not write"
 			    " protected", m));
 			vm_page_undirty(m);
 			vm_page_lock(m);
-			vm_page_deactivate(m);
+			vm_page_deactivate_noreuse(m);
 			vm_page_unlock(m);
 			vm_page_sunbusy(m);
 		}


More information about the svn-src-user mailing list