* If steal_pages() stole more than originally asked for, it might have lost those pages in the

non-reserve case.
* vm_page_allocate_page() could also lose a stolen page in case more free pages were available
  after steal_pages() was called.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22834 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2007-11-05 11:37:02 +00:00
parent a66c2a2c9e
commit 5ff3d4f2db

View File

@ -974,7 +974,7 @@ steal_pages(vm_page **pages, size_t count, bool reserve)
break;
if (steal_page(page, false)) {
if (reserve) {
if (reserve || stolen >= maxCount) {
InterruptsSpinLocker _(sPageLock);
enqueue_page(&sFreePageQueue, page);
page->state = PAGE_STATE_FREE;
@ -1374,10 +1374,8 @@ vm_page_allocate_page(int pageState, bool reserved)
size_t stolen = steal_pages(&page, 1, false);
locker.Lock();
if (stolen == 0) {
// just try again
continue;
}
if (stolen > 0)
break;
}
if (page->cache != NULL)