Author: alc
Date: Sun Dec 11 19:24:41 2016
New Revision: 309855
URL: https://svnweb.freebsd.org/changeset/base/309855

Log:
  When tmpfs and POSIX shm pagein a page for the sole purpose of performing
  truncation, immediately queue the page for asynchronous laundering rather
  than making the page pass through inactive queue first.
  
  Reviewed by:  kib, markj

Modified:
  head/sys/fs/tmpfs/tmpfs_subr.c
  head/sys/kern/uipc_shm.c

Modified: head/sys/fs/tmpfs/tmpfs_subr.c
==============================================================================
--- head/sys/fs/tmpfs/tmpfs_subr.c      Sun Dec 11 19:01:27 2016        
(r309854)
+++ head/sys/fs/tmpfs/tmpfs_subr.c      Sun Dec 11 19:24:41 2016        
(r309855)
@@ -1376,7 +1376,15 @@ retry:
                                    NULL);
                                vm_page_lock(m);
                                if (rv == VM_PAGER_OK) {
-                                       vm_page_deactivate(m);
+                                       /*
+                                        * Since the page was not resident,
+                                        * and therefore not recently
+                                        * accessed, immediately enqueue it
+                                        * for asynchronous laundering.  The
+                                        * current operation is not regarded
+                                        * as an access.
+                                        */
+                                       vm_page_launder(m);
                                        vm_page_unlock(m);
                                        vm_page_xunbusy(m);
                                } else {

Modified: head/sys/kern/uipc_shm.c
==============================================================================
--- head/sys/kern/uipc_shm.c    Sun Dec 11 19:01:27 2016        (r309854)
+++ head/sys/kern/uipc_shm.c    Sun Dec 11 19:24:41 2016        (r309855)
@@ -460,7 +460,15 @@ retry:
                                    NULL);
                                vm_page_lock(m);
                                if (rv == VM_PAGER_OK) {
-                                       vm_page_deactivate(m);
+                                       /*
+                                        * Since the page was not resident,
+                                        * and therefore not recently
+                                        * accessed, immediately enqueue it
+                                        * for asynchronous laundering.  The
+                                        * current operation is not regarded
+                                        * as an access.
+                                        */
+                                       vm_page_launder(m);
                                        vm_page_unlock(m);
                                        vm_page_xunbusy(m);
                                } else {
_______________________________________________
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