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
This commit is contained in:
Alan Cox
2016-12-11 19:24:41 +00:00
parent 5ab0f0c3f0
commit 2d612d2dd2
2 changed files with 18 additions and 2 deletions
+9 -1
View File
@@ -1376,7 +1376,15 @@ tmpfs_reg_resize(struct vnode *vp, off_t newsize, boolean_t ignerr)
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 {
+9 -1
View File
@@ -460,7 +460,15 @@ shm_dotruncate(struct shmfd *shmfd, off_t length)
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 {