Skip to content

Commit 6b149f7

Browse files
authored
[scudo] Dump ReleaseToOsIntervalMs (#86887)
This can be adjusted during runtime and it may impact the memory footprint if it's set to a big value or is disabled.
1 parent 6373577 commit 6b149f7

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

compiler-rt/lib/scudo/standalone/primary64.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,10 +372,11 @@ template <typename Config> class SizeClassAllocator64 {
372372
PushedBlocks += Region->FreeListInfo.PushedBlocks;
373373
}
374374
}
375+
const s32 IntervalMs = atomic_load_relaxed(&ReleaseToOsIntervalMs);
375376
Str->append("Stats: SizeClassAllocator64: %zuM mapped (%uM rss) in %zu "
376-
"allocations; remains %zu\n",
377+
"allocations; remains %zu; ReleaseToOsIntervalMs = %d\n",
377378
TotalMapped >> 20, 0U, PoppedBlocks,
378-
PoppedBlocks - PushedBlocks);
379+
PoppedBlocks - PushedBlocks, IntervalMs >= 0 ? IntervalMs : -1);
379380

380381
for (uptr I = 0; I < NumClasses; I++) {
381382
RegionInfo *Region = getRegionInfo(I);

compiler-rt/lib/scudo/standalone/secondary.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,12 @@ template <typename Config> class MapAllocatorCache {
179179
uptr Fractional;
180180
computePercentage(SuccessfulRetrieves, CallsToRetrieve, &Integral,
181181
&Fractional);
182-
Str->append("Stats: MapAllocatorCache: EntriesCount: %d, "
183-
"MaxEntriesCount: %u, MaxEntrySize: %zu\n",
184-
EntriesCount, atomic_load_relaxed(&MaxEntriesCount),
185-
atomic_load_relaxed(&MaxEntrySize));
182+
const s32 Interval = atomic_load_relaxed(&ReleaseToOsIntervalMs);
183+
Str->append(
184+
"Stats: MapAllocatorCache: EntriesCount: %d, "
185+
"MaxEntriesCount: %u, MaxEntrySize: %zu, ReleaseToOsIntervalMs = %d\n",
186+
EntriesCount, atomic_load_relaxed(&MaxEntriesCount),
187+
atomic_load_relaxed(&MaxEntrySize), Interval >= 0 ? Interval : -1);
186188
Str->append("Stats: CacheRetrievalStats: SuccessRate: %u/%u "
187189
"(%zu.%02zu%%)\n",
188190
SuccessfulRetrieves, CallsToRetrieve, Integral, Fractional);

0 commit comments

Comments
 (0)