diff --git a/compiler-rt/lib/scudo/standalone/primary64.h b/compiler-rt/lib/scudo/standalone/primary64.h index 2b520ceb33148..e7da849c339bf 100644 --- a/compiler-rt/lib/scudo/standalone/primary64.h +++ b/compiler-rt/lib/scudo/standalone/primary64.h @@ -1141,18 +1141,18 @@ template class SizeClassAllocator64 { BytesInFreeList - Region->ReleaseInfo.BytesInFreeListAtLastCheckpoint; } const uptr TotalChunks = Region->MemMapInfo.AllocatedUser / BlockSize; - Str->append( - "%s %02zu (%6zu): mapped: %6zuK popped: %7zu pushed: %7zu " - "inuse: %6zu total: %6zu releases: %6zu last " - "releases attempted: %6zuK latest pushed bytes: %6zuK region: 0x%zx " - "(0x%zx)\n", - Region->Exhausted ? "E" : " ", ClassId, getSizeByClassId(ClassId), - Region->MemMapInfo.MappedUser >> 10, Region->FreeListInfo.PoppedBlocks, - Region->FreeListInfo.PushedBlocks, InUseBlocks, TotalChunks, - Region->ReleaseInfo.NumReleasesAttempted, - Region->ReleaseInfo.LastReleasedBytes >> 10, - RegionPushedBytesDelta >> 10, Region->RegionBeg, - getRegionBaseByClassId(ClassId)); + Str->append("%s %02zu (%6zu): mapped: %6zuK popped: %7zu pushed: %7zu " + "inuse: %6zu total: %6zu releases attempted: %6zu last " + "released: %6zuK latest pushed bytes: %6zuK region: 0x%zx " + "(0x%zx)\n", + Region->Exhausted ? "E" : " ", ClassId, + getSizeByClassId(ClassId), Region->MemMapInfo.MappedUser >> 10, + Region->FreeListInfo.PoppedBlocks, + Region->FreeListInfo.PushedBlocks, InUseBlocks, TotalChunks, + Region->ReleaseInfo.NumReleasesAttempted, + Region->ReleaseInfo.LastReleasedBytes >> 10, + RegionPushedBytesDelta >> 10, Region->RegionBeg, + getRegionBaseByClassId(ClassId)); } void getRegionFragmentationInfo(RegionInfo *Region, uptr ClassId, @@ -1297,6 +1297,10 @@ template class SizeClassAllocator64 { return 0; } + // The following steps contribute to the majority time spent in page + // releasing thus we increment the counter here. + ++Region->ReleaseInfo.NumReleasesAttempted; + // Note that we have extracted the `GroupsToRelease` from region freelist. // It's safe to let pushBlocks()/popBlocks() access the remaining region // freelist. In the steps 3 and 4, we will temporarily release the FLLock