summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/uipc_shm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c
index cf7212f24e26..0154a4076182 100644
--- a/sys/kern/uipc_shm.c
+++ b/sys/kern/uipc_shm.c
@@ -287,6 +287,10 @@ shm_dotruncate(struct shmfd *shmfd, off_t length)
if (m->dirty != 0)
m->dirty = VM_PAGE_BITS_ALL;
vm_page_unlock_queues();
+ } else if ((length & PAGE_MASK) &&
+ __predict_false(object->cache != NULL)) {
+ vm_page_cache_free(object, OFF_TO_IDX(length),
+ nobjsize);
}
}
shmfd->shm_size = length;