Added a variable that tracks the FragmentedBytes in the secondary cache.
Updates this information after successful retrieves and stores. Dumps
info in getStats().
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
compiler-rt/lib/scudo/standalone/secondary.h | ||
---|---|---|
262 | I think we may want to track all secondary allocations because we don't know if a returned block is cached before. Then we add the fragmented bytes at every allocation and subtract it at every deallocation |
compiler-rt/lib/scudo/standalone/secondary.h | ||
---|---|---|
262 | So I should be doing these calculations in the allocate & deallocate methods instead of retrieve and store? |
compiler-rt/lib/scudo/standalone/secondary.h | ||
---|---|---|
262 | Right, so that we won't miss some of them like if the cache is full, you can't store it |
Stats: MapAllocator: allocated 34 times (2404K), freed 34 times (2404K), remains 0 (0K) max 0M, Fragmented 18014398509481850K
.
.
.
Stats: MapAllocator: allocated 7683 times (1066772K), freed 7683 times (1066772K), remains 0 (0K) max 1M, Fragmented 4081387162245704K
.
.
.
Stats: MapAllocator: allocated 32 times (1180K), freed 32 times (1180K), remains 0 (0K) max 0M, Fragmented 15762598695796610K
.
.
.
These are the values I am getting, which do not make sense, I assume my arithmetic is leading to overflow
compiler-rt/lib/scudo/standalone/secondary.h | ||
---|---|---|
670 | I think you also want to account the Fragmented bytes here |
compiler-rt/lib/scudo/standalone/secondary.h | ||
---|---|---|
670 | I added the calculation here and now I am getting 0K fragmented |
compiler-rt/lib/scudo/standalone/secondary.h | ||
---|---|---|
701 | I was dumping this in the CacheRetrieveStats, but now since I am doing the calculations in the MapAllocator, it is getting dumped here. I am wondering if I should also move the SuccessRate to this getStats()? |
I think we may want to track all secondary allocations because we don't know if a returned block is cached before. Then we add the fragmented bytes at every allocation and subtract it at every deallocation