зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1078437 - Prevent store buffer compaction from thrashing, r=terrence
--HG-- extra : rebase_source : e1e4096b7c975568471036868104a7e7ee05c9d6
This commit is contained in:
Родитель
1700296f02
Коммит
b68f37bd29
|
@ -97,7 +97,7 @@ StoreBuffer::MonoTypeBuffer<T>::handleOverflow(StoreBuffer *owner)
|
|||
* trigger a minor collection.
|
||||
*/
|
||||
compact(owner);
|
||||
if (isAboutToOverflow())
|
||||
if (isLowOnSpace())
|
||||
owner->setAboutToOverflow();
|
||||
} else {
|
||||
/*
|
||||
|
|
|
@ -78,7 +78,18 @@ class StoreBuffer
|
|||
friend class mozilla::ReentrancyGuard;
|
||||
|
||||
/* The size at which a block is about to overflow. */
|
||||
static const size_t MinAvailableSize = (size_t)(LifoAllocBlockSize * 1.0 / 8.0);
|
||||
static const size_t LowAvailableThreshold = (size_t)(LifoAllocBlockSize * 1.0 / 16.0);
|
||||
|
||||
/*
|
||||
* If the space available in the store buffer hits the
|
||||
* LowAvailableThreshold and gets compacted, but still doesn't have at
|
||||
* least HighAvailableThreshold space available, then we will trigger a
|
||||
* minor GC. HighAvailableThreshold should be set to provide enough space
|
||||
* for the mutator to run for a while in between compactions. (If
|
||||
* HighAvailableThreshold is too low, we will thrash and spend most of the
|
||||
* time compacting. If it is too high, we will tenure things too early.)
|
||||
*/
|
||||
static const size_t HighAvailableThreshold = (size_t)(LifoAllocBlockSize * 1.0 / 4.0);
|
||||
|
||||
/*
|
||||
* This buffer holds only a single type of edge. Using this buffer is more
|
||||
|
@ -110,7 +121,11 @@ class StoreBuffer
|
|||
}
|
||||
|
||||
bool isAboutToOverflow() const {
|
||||
return !storage_->isEmpty() && storage_->availableInCurrentChunk() < MinAvailableSize;
|
||||
return !storage_->isEmpty() && storage_->availableInCurrentChunk() < LowAvailableThreshold;
|
||||
}
|
||||
|
||||
bool isLowOnSpace() const {
|
||||
return !storage_->isEmpty() && storage_->availableInCurrentChunk() < HighAvailableThreshold;
|
||||
}
|
||||
|
||||
void handleOverflow(StoreBuffer *owner);
|
||||
|
@ -189,7 +204,7 @@ class StoreBuffer
|
|||
}
|
||||
|
||||
bool isAboutToOverflow() const {
|
||||
return !storage_->isEmpty() && storage_->availableInCurrentChunk() < MinAvailableSize;
|
||||
return !storage_->isEmpty() && storage_->availableInCurrentChunk() < LowAvailableThreshold;
|
||||
}
|
||||
|
||||
/* Mark all generic edges. */
|
||||
|
|
Загрузка…
Ссылка в новой задаче