[K/N] Re-enable mutator assist

Also remove disabling of GC scheduling during GC
This commit is contained in:
Troels Bjerre Lund
2023-09-28 16:05:26 +02:00
committed by Space Cloud
parent a752d5d000
commit bb195749c8
4 changed files with 7 additions and 6 deletions
@@ -116,6 +116,12 @@ std::vector<ObjHeader*> Heap::GetAllocatedObjects() noexcept {
return unfinalized;
}
// This overhead is calculated under the assumption that each thread holds on
// to one almost empty page of each page type currently in use. Thus, the
// per-thread-overhead is the sum of the page sizes of the page types that the
// Heap has currently allocated, i.e., whose PageStores are not empty. This
// estimate has two-sided error, and there are still pathological allocation
// patterns that would lead to constant GC triggering.
size_t Heap::EstimateOverheadPerThread() noexcept {
size_t overHeadPerThread = 0;
if (!nextFitPages_.isEmpty()) overHeadPerThread += NEXT_FIT_PAGE_SIZE;
@@ -64,7 +64,6 @@ public:
void onGCStart() noexcept {
regularIntervalPacer_.OnPerformFullGC();
heapGrowthController_.unsetBoundaries();
timer_.restart(config_.regularGcInterval());
}
@@ -40,7 +40,7 @@ struct GCSchedulerConfig {
std::atomic<double> heapTriggerCoefficient = 0.9;
// See `mutatorAssists()`.
std::atomic<std::underlying_type_t<MutatorAssists>> mutatorAssistsImpl =
static_cast<std::underlying_type_t<MutatorAssists>>(MutatorAssists::kDisable);
static_cast<std::underlying_type_t<MutatorAssists>>(MutatorAssists::kDefault);
std::chrono::microseconds regularGcInterval() const { return std::chrono::microseconds(regularGcIntervalMicroseconds.load()); }
@@ -31,10 +31,6 @@ public:
triggerHeapBytes_ = targetHeapBytes_ * config_.heapTriggerCoefficient.load(std::memory_order_relaxed);
}
void unsetBoundaries() noexcept {
targetHeapBytes_ = triggerHeapBytes_ = std::numeric_limits<int64_t>::max();
}
// Can be called by any thread.
MemoryBoundary boundaryForHeapSize(size_t totalAllocatedBytes) noexcept {
if (totalAllocatedBytes >= targetHeapBytes_) {