In case the source cache of the current vm_cache_ref was in the process of

being merged in vm_cache_remove_consumer(), fault_find_page() tried again
with the current vm_cache_ref, but didn't realize it might have had inserted
a busy page in this cache already.
This fixes a deadlock, as this page would never get unbusy again.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20470 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2007-03-30 12:14:43 +00:00
parent 94d37a4b51
commit 3a1532ef98
1 changed files with 3 additions and 4 deletions

View File

@ -3215,8 +3215,7 @@ fault_find_page(vm_translation_map *map, vm_cache_ref *topCacheRef,
vm_page_set_state(page, PAGE_STATE_BUSY);
break;
}
if (page == NULL)
if (page == NULL || page == &dummyPage)
break;
// page must be busy
@ -3226,14 +3225,14 @@ fault_find_page(vm_translation_map *map, vm_cache_ref *topCacheRef,
mutex_lock(&cacheRef->lock);
}
if (page != NULL)
if (page != NULL && page != &dummyPage)
break;
// The current cache does not contain the page we're looking for
// If we're at the top most cache, insert the dummy page here to keep other threads
// from faulting on the same address and chasing us up the cache chain
if (cacheRef == topCacheRef)
if (cacheRef == topCacheRef && dummyPage.state != PAGE_STATE_BUSY)
fault_insert_dummy_page(cacheRef, dummyPage, cacheOffset);
// see if the vm_store has it