diff options
author | alc <alc@FreeBSD.org> | 2010-04-17 17:02:17 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2010-04-17 17:02:17 +0000 |
commit | 06e8a2d9cc07fd9f1ac05866b936f2e78cc458ec (patch) | |
tree | 6f28bead74e9494fb790ce0200895ccaf9561aea | |
parent | e3a8d034ba069ba5a7dad2818a3994f2e52c5dff (diff) | |
download | FreeBSD-src-06e8a2d9cc07fd9f1ac05866b936f2e78cc458ec.zip FreeBSD-src-06e8a2d9cc07fd9f1ac05866b936f2e78cc458ec.tar.gz |
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
-rw-r--r-- | sys/vm/swap_pager.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index ef64b31..f1d89d5 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -1101,8 +1101,7 @@ swap_pager_getpages(vm_object_t object, vm_page_t *m, int count, int reqpage) * 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_page_t *m, int count, int reqpage) 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( |