summaryrefslogtreecommitdiffstats
path: root/sys/vm/swap_pager.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2010-05-09 16:27:42 +0000
committeralc <alc@FreeBSD.org>2010-05-09 16:27:42 +0000
commit7e9950f550edacc2c51a0923ec07925da9807830 (patch)
tree1f6bd9e213f7b1e7918a3a9e0065bd80705c1c90 /sys/vm/swap_pager.c
parent3c5524966436b94e8e8cf2be33f539a27e3b67e9 (diff)
downloadFreeBSD-src-7e9950f550edacc2c51a0923ec07925da9807830.zip
FreeBSD-src-7e9950f550edacc2c51a0923ec07925da9807830.tar.gz
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().
Diffstat (limited to 'sys/vm/swap_pager.c')
-rw-r--r--sys/vm/swap_pager.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index 7556572..b359bd4 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -1719,11 +1719,9 @@ swp_pager_force_pagein(vm_object_t object, vm_pindex_t pindex)
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);
OpenPOWER on IntegriCloud