Author: alc
Date: Mon Oct  2 07:14:32 2017
New Revision: 324189
URL: https://svnweb.freebsd.org/changeset/base/324189

Log:
  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

Modified:
  head/sys/dev/md/md.c

Modified: head/sys/dev/md/md.c
==============================================================================
--- head/sys/dev/md/md.c        Mon Oct  2 06:48:56 2017        (r324188)
+++ head/sys/dev/md/md.c        Mon Oct  2 07:14:32 2017        (r324189)
@@ -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);
                }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to