Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Oct 2016 19:40:37 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r307750 - user/alc/PQ_LAUNDRY/sys/vm
Message-ID:  <201610211940.u9LJebIG036898@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Fri Oct 21 19:40:37 2016
New Revision: 307750
URL: https://svnweb.freebsd.org/changeset/base/307750

Log:
  Have madvise(MADV_DONTNEED) move dirty pages to the laundry queue.
  
  Previously we would always requeue such pages at the tail of the inactive
  queue, which would further delay reclamation of a page already in the
  laundry queue.
  
  Discussed with:	alc

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

Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_page.c
==============================================================================
--- user/alc/PQ_LAUNDRY/sys/vm/vm_page.c	Fri Oct 21 19:23:51 2016	(r307749)
+++ user/alc/PQ_LAUNDRY/sys/vm/vm_page.c	Fri Oct 21 19:40:37 2016	(r307750)
@@ -3310,11 +3310,13 @@ vm_page_advise(vm_page_t m, int advice)
 	/*
 	 * Place clean pages near the head of the inactive queue rather than
 	 * the tail, thus defeating the queue's LRU operation and ensuring that
-	 * the page will be reused quickly.  Dirty pages are given a chance to
-	 * cycle once through the inactive queue before becoming eligible for
-	 * laundering.
+	 * the page will be reused quickly.  Dirty pages not already in the
+	 * laundry are moved there.
 	 */
-	_vm_page_deactivate(m, m->dirty == 0);
+	if (m->dirty == 0)
+		_vm_page_deactivate(m, TRUE);
+	else
+		vm_page_launder(m);
 }
 
 /*



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