Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Apr 2010 09:57:25 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r207364 - head/sys/vm
Message-ID:  <201004290957.o3T9vPBR014000@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Thu Apr 29 09:57:25 2010
New Revision: 207364
URL: http://svn.freebsd.org/changeset/base/207364

Log:
  In swap pager, do not free the non-requested pages from the run if they are
  wired. Kstack pages are wired, this change prepares swap pager for handling
  of long runs of kstack pages.
  
  Noted and reviewed by:	alc
  Tested by:	pho
  MFC after:	2 weeks

Modified:
  head/sys/vm/swap_pager.c

Modified: head/sys/vm/swap_pager.c
==============================================================================
--- head/sys/vm/swap_pager.c	Thu Apr 29 09:55:51 2010	(r207363)
+++ head/sys/vm/swap_pager.c	Thu Apr 29 09:57:25 2010	(r207364)
@@ -378,6 +378,14 @@ static void swp_pager_meta_free(vm_objec
 static void swp_pager_meta_free_all(vm_object_t);
 static daddr_t swp_pager_meta_ctl(vm_object_t, vm_pindex_t, int);
 
+static void
+swp_pager_free_nrpage(vm_page_t m)
+{
+
+	if (m->wire_count == 0)
+		vm_page_free(m);
+}
+
 /*
  * SWP_SIZECHECK() -	update swap_pager_full indication
  *	
@@ -1131,9 +1139,9 @@ swap_pager_getpages(vm_object_t object, 
 
 		vm_page_lock_queues();
 		for (k = 0; k < i; ++k)
-			vm_page_free(m[k]);
+			swp_pager_free_nrpage(m[k]);
 		for (k = j; k < count; ++k)
-			vm_page_free(m[k]);
+			swp_pager_free_nrpage(m[k]);
 		vm_page_unlock_queues();
 	}
 
@@ -1529,7 +1537,7 @@ swp_pager_async_iodone(struct buf *bp)
 				 */
 				m->valid = 0;
 				if (i != bp->b_pager.pg_reqpage)
-					vm_page_free(m);
+					swp_pager_free_nrpage(m);
 				else
 					vm_page_flash(m);
 				/*



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