svn commit: r260213 - user/alc/cachefree/sys/vm

Alan Cox alc at FreeBSD.org
Fri Jan 3 00:18:39 UTC 2014


Author: alc
Date: Fri Jan  3 00:18:38 2014
New Revision: 260213
URL: http://svnweb.freebsd.org/changeset/base/260213

Log:
  Free the page instead of caching it in vm_pageout_scan().
  
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  user/alc/cachefree/sys/vm/vm_pageout.c

Modified: user/alc/cachefree/sys/vm/vm_pageout.c
==============================================================================
--- user/alc/cachefree/sys/vm/vm_pageout.c	Fri Jan  3 00:17:52 2014	(r260212)
+++ user/alc/cachefree/sys/vm/vm_pageout.c	Fri Jan  3 00:18:38 2014	(r260213)
@@ -1095,29 +1095,21 @@ vm_pageout_scan(struct vm_domain *vmd, i
 		/*
 		 * If the page appears to be clean at the machine-independent
 		 * layer, then remove all of its mappings from the pmap in
-		 * anticipation of placing it onto the cache queue.  If,
-		 * however, any of the page's mappings allow write access,
-		 * then the page may still be modified until the last of those
-		 * mappings are removed.
+		 * anticipation of freeing it.  If, however, any of the page's
+		 * mappings allow write access, then the page may still be
+		 * modified until the last of those mappings are removed.
 		 */
 		vm_page_test_dirty(m);
 		if (m->dirty == 0 && object->ref_count != 0)
 			pmap_remove_all(m);
 
-		if (m->valid == 0) {
+		if (m->dirty == 0) {
 			/*
-			 * Invalid pages can be easily freed
+			 * Invalid pages must be clean.
 			 */
 			vm_page_free(m);
 			PCPU_INC(cnt.v_dfree);
 			--page_shortage;
-		} else if (m->dirty == 0) {
-			/*
-			 * Clean pages can be placed onto the cache queue.
-			 * This effectively frees them.
-			 */
-			vm_page_cache(m);
-			--page_shortage;
 		} else if ((m->flags & PG_WINATCFLS) == 0 && pass < 2) {
 			/*
 			 * Dirty pages need to be paged out, but flushing


More information about the svn-src-user mailing list