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
This commit is contained in:
parent
5090437236
commit
aefac17759
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user