Fixed a quasi-livelock in steal_pages() as proposed in ticket #1929.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24605 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1223,11 +1223,17 @@ steal_pages(vm_page **pages, size_t count, bool reserve)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (tried) {
|
if (tried) {
|
||||||
// we had our go, but there are pages left, let someone else
|
// We tried all potential pages, but one or more couldn't be stolen
|
||||||
// try
|
// at that time (likely because their cache was locked). No one
|
||||||
|
// else will have any better luck, so we'll just retry a little
|
||||||
|
// later.
|
||||||
|
// TODO: Think about better strategies. E.g. if our condition
|
||||||
|
// variables had timeouts, we could just wait with timeout on
|
||||||
|
// the free page queue condition variable, which could might
|
||||||
|
// succeed earlier.
|
||||||
locker.Unlock();
|
locker.Unlock();
|
||||||
sFreePageCondition.NotifyOne();
|
snooze(10000);
|
||||||
locker.Lock();
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// we need to wait for pages to become inactive
|
// we need to wait for pages to become inactive
|
||||||
|
|||||||
Reference in New Issue
Block a user