svn commit: r206761 - head/sys/vm
Alan Cox
alc at FreeBSD.org
Sat Apr 17 17:02:17 UTC 2010
Author: alc
Date: Sat Apr 17 17:02:17 2010
New Revision: 206761
URL: http://svn.freebsd.org/changeset/base/206761
Log:
Setting PG_REFERENCED on the requested page in swap_pager_getpages() is
either redundant or harmful, depending on the caller. For example, when
called by vm_fault(), it is redundant. However, when called by
vm_thread_swapin(), it is harmful. Specifically, if the thread is later
swapped out, having PG_REFERENCED set on its stack pages leads the page
daemon to reactivate these stack pages and delay their reclamation.
Reviewed by: kib
MFC after: 3 weeks
Modified:
head/sys/vm/swap_pager.c
Modified: head/sys/vm/swap_pager.c
==============================================================================
--- head/sys/vm/swap_pager.c Sat Apr 17 15:52:50 2010 (r206760)
+++ head/sys/vm/swap_pager.c Sat Apr 17 17:02:17 2010 (r206761)
@@ -1101,8 +1101,7 @@ swap_pager_getpages(vm_object_t object,
* happen. Note that blk, iblk & jblk can be SWAPBLK_NONE, but the
* loops are set up such that the case(s) are handled implicitly.
*
- * The swp_*() calls must be made at splvm(). vm_page_free() does
- * not need to be, but it will go a little faster if it is.
+ * The swp_*() calls must be made with the object locked.
*/
blk = swp_pager_meta_ctl(mreq->object, mreq->pindex, 0);
@@ -1212,9 +1211,6 @@ swap_pager_getpages(vm_object_t object,
VM_OBJECT_LOCK(object);
while ((mreq->oflags & VPO_SWAPINPROG) != 0) {
mreq->oflags |= VPO_WANTED;
- vm_page_lock_queues();
- vm_page_flag_set(mreq, PG_REFERENCED);
- vm_page_unlock_queues();
PCPU_INC(cnt.v_intrans);
if (msleep(mreq, VM_OBJECT_MTX(object), PSWP, "swread", hz*20)) {
printf(
More information about the svn-src-all
mailing list