[compiler-rt] [scudo] Add time of last page release to getStats() (PR #164004)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 17 22:50:19 PDT 2025
================
@@ -1146,17 +1148,24 @@ void SizeClassAllocator64<Config>::getStats(ScopedString *Str, uptr ClassId,
BytesInFreeList - Region->ReleaseInfo.BytesInFreeListAtLastCheckpoint;
}
const uptr TotalChunks = Region->MemMapInfo.AllocatedUser / BlockSize;
+ const u64 CurTimeNs = getMonotonicTime();
+ const u64 DiffSinceLastReleaseNs =
+ CurTimeNs - Region->ReleaseInfo.LastReleaseAtNs;
+ const u64 LastReleaseSecAgo = DiffSinceLastReleaseNs / 1000000000;
+ const u64 LastReleaseMsAgo = (DiffSinceLastReleaseNs % 1000000000) / 1000000;
+
----------------
ChiaHungDuan wrote:
I have a new thought about this, given that we have `ReleaseToOsInterval`, can we print something like `> ReleaseToOsInterval` `< ReleaseToOsInterval`?
If we hit the threshold to do the page release but it's too close (diff time less than ReleaseToOsInterval) then we will skip the page release. Thus I think longer/shorter than the interval gives us enough information about why the pages aren't released.
Sorry I didn't think about this while came up with the work
https://github.com/llvm/llvm-project/pull/164004
More information about the llvm-commits
mailing list