* The test for existing mappings in vm_remove_consumer() was a bit too aggressive;
if the page is currently copied, the source page still has mappings. * vm_copy_on_write_area() did not set the cache type for the upper cache. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20530 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
48e0491d5a
commit
1407f23d9b
@ -1586,6 +1586,7 @@ vm_copy_on_write_area(vm_area *area)
|
|||||||
// we need to hold the cache_ref lock when we want to switch its cache
|
// we need to hold the cache_ref lock when we want to switch its cache
|
||||||
mutex_lock(&lowerCacheRef->lock);
|
mutex_lock(&lowerCacheRef->lock);
|
||||||
|
|
||||||
|
upperCache->type = CACHE_TYPE_RAM;
|
||||||
upperCache->temporary = 1;
|
upperCache->temporary = 1;
|
||||||
upperCache->scan_skip = lowerCache->scan_skip;
|
upperCache->scan_skip = lowerCache->scan_skip;
|
||||||
upperCache->virtual_base = lowerCache->virtual_base;
|
upperCache->virtual_base = lowerCache->virtual_base;
|
||||||
|
@ -528,16 +528,22 @@ vm_cache_remove_consumer(vm_cache_ref *cacheRef, vm_cache *consumer)
|
|||||||
cache, cacheRef->ref_count, consumer));
|
cache, cacheRef->ref_count, consumer));
|
||||||
|
|
||||||
for (page = cache->page_list; page != NULL; page = nextPage) {
|
for (page = cache->page_list; page != NULL; page = nextPage) {
|
||||||
|
vm_page *consumerPage;
|
||||||
nextPage = page->cache_next;
|
nextPage = page->cache_next;
|
||||||
|
|
||||||
if (vm_cache_lookup_page(consumerRef,
|
consumerPage = vm_cache_lookup_page(consumerRef,
|
||||||
(off_t)page->cache_offset << PAGE_SHIFT) == NULL) {
|
(off_t)page->cache_offset << PAGE_SHIFT);
|
||||||
// the page already is not yet in the consumer cache - move it upwards
|
if (consumerPage == NULL) {
|
||||||
|
// the page already is not yet in the consumer cache - move
|
||||||
|
// it upwards
|
||||||
vm_cache_remove_page(cacheRef, page);
|
vm_cache_remove_page(cacheRef, page);
|
||||||
vm_cache_insert_page(consumerRef, page,
|
vm_cache_insert_page(consumerRef, page,
|
||||||
(off_t)page->cache_offset << PAGE_SHIFT);
|
(off_t)page->cache_offset << PAGE_SHIFT);
|
||||||
} else if (page->mappings != 0 || page->wired_count != 0)
|
} else if (consumerPage->state != PAGE_STATE_BUSY
|
||||||
panic("page %p has still mappings!", page);
|
&& (page->mappings != 0 || page->wired_count != 0)) {
|
||||||
|
panic("page %p has still mappings (consumer cache %p)!",
|
||||||
|
page, consumerRef);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
newSource = cache->source;
|
newSource = cache->source;
|
||||||
|
Loading…
Reference in New Issue
Block a user