When mdstart_swap() accesses a page that is already in the active queue,

mark the page as referenced rather than calling vm_page_activate().  This
allows the page's act_count to grow beyond ACT_INIT and better reflect
its usage.  (See also r324146, which modified a function used by tmpfs,
uiomove_object_page(), to behave in the same way.)

Reviewed by:	kib, markj
MFC after:	2 weeks
This commit is contained in:
Alan Cox 2017-10-02 07:14:32 +00:00
parent 10b980e75b
commit d9ccb9a89f

View File

@ -1111,7 +1111,10 @@ mdstart_swap(struct md_s *sc, struct bio *bp)
if (m != NULL) {
vm_page_xunbusy(m);
vm_page_lock(m);
vm_page_activate(m);
if (vm_page_active(m))
vm_page_reference(m);
else
vm_page_activate(m);
vm_page_unlock(m);
}