svn commit: r207822 - head/sys/vm

Alan Cox alc at FreeBSD.org
Sun May 9 16:27:43 UTC 2010


Author: alc
Date: Sun May  9 16:27:42 2010
New Revision: 207822
URL: http://svn.freebsd.org/changeset/base/207822

Log:
  Call vm_page_deactivate() rather than vm_page_dontneed() in
  swp_pager_force_pagein().  By dirtying the page, swp_pager_force_pagein()
  forces vm_page_dontneed() to insert the page at the head of the inactive
  queue, just like vm_page_deactivate() does.  Moreover, because the page
  was invalid, it can't have been mapped, and thus the other effect of
  vm_page_dontneed(), clearing the page's reference bits has no effect.  In
  summary, there is no reason to call vm_page_dontneed() since its effect
  will be identical to calling the simpler vm_page_deactivate().

Modified:
  head/sys/vm/swap_pager.c

Modified: head/sys/vm/swap_pager.c
==============================================================================
--- head/sys/vm/swap_pager.c	Sun May  9 16:15:40 2010	(r207821)
+++ head/sys/vm/swap_pager.c	Sun May  9 16:27:42 2010	(r207822)
@@ -1719,11 +1719,9 @@ swp_pager_force_pagein(vm_object_t objec
 	if (swap_pager_getpages(object, &m, 1, 0) != VM_PAGER_OK)
 		panic("swap_pager_force_pagein: read from swap failed");/*XXX*/
 	vm_object_pip_subtract(object, 1);
-	vm_page_lock(m);
-	vm_page_lock_queues();
 	vm_page_dirty(m);
-	vm_page_dontneed(m);
-	vm_page_unlock_queues();
+	vm_page_lock(m);
+	vm_page_deactivate(m);
 	vm_page_unlock(m);
 	vm_page_wakeup(m);
 	vm_pager_page_unswapped(m);


More information about the svn-src-all mailing list