diff options
author | alc <alc@FreeBSD.org> | 2011-06-29 16:40:41 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2011-06-29 16:40:41 +0000 |
commit | 21902be08cad124037a2152459b485a54308e5ca (patch) | |
tree | bffb0499b364b344b9d5ddbae978932a240d3045 /sys/kern | |
parent | 7b0555e88a9f208857e299f3e8380d8c8f67119b (diff) | |
download | FreeBSD-src-21902be08cad124037a2152459b485a54308e5ca.zip FreeBSD-src-21902be08cad124037a2152459b485a54308e5ca.tar.gz |
Add a new option, OBJPR_NOTMAPPED, to vm_object_page_remove(). Passing this
option to vm_object_page_remove() asserts that the specified range of pages
is not mapped, or more precisely that none of these pages have any managed
mappings. Thus, vm_object_page_remove() need not call pmap_remove_all() on
the pages.
This change not only saves time by eliminating pointless calls to
pmap_remove_all(), but it also eliminates an inconsistency in the use of
pmap_remove_all() versus related functions, like pmap_remove_write(). It
eliminates harmless but pointless calls to pmap_remove_all() that were being
performed on PG_UNMANAGED pages.
Update all of the existing assertions on pmap_remove_all() to reflect this
change.
Reviewed by: kib
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/uipc_shm.c | 2 | ||||
-rw-r--r-- | sys/kern/vfs_subr.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c index 00496af..cea70c7 100644 --- a/sys/kern/uipc_shm.c +++ b/sys/kern/uipc_shm.c @@ -264,7 +264,7 @@ shm_dotruncate(struct shmfd *shmfd, off_t length) /* Toss in memory pages. */ if (nobjsize < object->size) vm_object_page_remove(object, nobjsize, object->size, - FALSE); + 0); /* Toss pages from swap. */ if (object->type == OBJT_SWAP) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index c5ae83c..934745b 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1190,8 +1190,8 @@ bufobj_invalbuf(struct bufobj *bo, int flags, int slpflag, int slptimeo) */ if (bo->bo_object != NULL && (flags & (V_ALT | V_NORMAL)) == 0) { VM_OBJECT_LOCK(bo->bo_object); - vm_object_page_remove(bo->bo_object, 0, 0, - (flags & V_SAVE) ? TRUE : FALSE); + vm_object_page_remove(bo->bo_object, 0, 0, (flags & V_SAVE) ? + OBJPR_CLEANONLY : 0); VM_OBJECT_UNLOCK(bo->bo_object); } |