Tracking the pushed bytes between to releaseToOSMaybe calls may lead to
a overestimated case that if we do malloc 2KB -> free 2KB -> malloc 2KB
-> free 2KB, we may think we have released 4KB but it only releases 2KB
actually. Switch to use bytes-in-freelist excludes more cases that can't
release the pages
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Continue how we measure the efficiency of early-exit releaseToOS in D146312,
scudo : -- Average Operation Time -- -- Name (# of Calls) -- scudo : 264.4(ns) releaseToOSMaybe (30981) scudo : 91.8(ns) TryMarkingBlocks (7118) scudo : 7935.0(ns) releaseFreeMemoryToOS (1)
(30981 - 7118) / 30981 ~= 77% of releaseToOSMaybe calls are excluded from trying of marking blocks. So far I didn't see the overall memory impact here thus I suppose we only exempt the cases that are supposed to release nothing.
Comment Actions
As mentioned, there is a difference between primary32 and primary64 that isn't clear.
compiler-rt/lib/scudo/standalone/primary64.h | ||
---|---|---|
832 | This isn't in the primary32.h, is there a fundamental difference that means this isn't needed in that one? |
Should this be skipped when force freeing everything?