aboutsummaryrefslogtreecommitdiff
path: root/sys/vm
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2007-11-05 10:25:12 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2007-11-05 10:25:12 +0000
commitaefac17759a536e61aa4d1e9289f10a2d144da00 (patch)
tree7d4c21b88763535ab63ea3fe8cc3e6d885b6e789 /sys/vm
parent50904372363165db42fdc100d02fed3229fb2936 (diff)
downloadsrc-aefac17759a536e61aa4d1e9289f10a2d144da00.tar.gz
src-aefac17759a536e61aa4d1e9289f10a2d144da00.zip
The intent of the freeing the (zeroed) page in vm_page_cache() for
default object rather than cache it was to have vm_pager_has_page(object, pindex, ...) == FALSE to imply that there is no cached page in object at pindex. This allows to avoid explicit checks for cached pages in vm_object_backing_scan(). For now, we need the same bandaid for the swap object, otherwise both the vm_page_lookup() and the pager can report that there is no page at offset, while page is stored in the cache. Also, this fixes another instance of the KASSERT("object type is incompatible") failure in the vm_page_cache_transfer(). Reported and tested by: Peter Holm Reviewed by: alc MFC after: 3 days
Notes
Notes: svn path=/head/; revision=173357
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_page.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index 28771cba57fe..8f186fee9b9d 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -1519,10 +1519,13 @@ vm_page_cache(vm_page_t m)
pmap_remove_all(m);
if (m->dirty != 0)
panic("vm_page_cache: page %p is dirty", m);
- if (m->valid == 0 || object->type == OBJT_DEFAULT) {
+ if (m->valid == 0 || object->type == OBJT_DEFAULT ||
+ (object->type == OBJT_SWAP &&
+ !vm_pager_has_page(object, m->pindex, NULL, NULL))) {
/*
* Hypothesis: A cache-elgible page belonging to a
- * default object must be zero filled.
+ * default object or swap object but without a backing
+ * store must be zero filled.
*/
vm_page_free(m);
return;