This is an archive of the discontinued LLVM Phabricator instance.

[scudo][standalone] Allow the release of smaller sizes
ClosedPublic

Authored by cryptoad on Dec 11 2020, 2:05 PM.

Details

Summary

Initially we were avoiding the release of smaller size classes due to
the fact that it was an expensive operation, particularly on 32-bit
platforms. With a lot of batches, and given that there are a lot of
blocks per page, this was a lengthy operation with little results.

There has been some improvements since then to the 32-bit release,
and we still have some criterias preventing us from wasting time
(eg, 9x% free blocks in the class size, etc).

Allowing to release blocks < 128 bytes helps in situations where a lot
of small chunks would not have been reclaimed if not for a forced
reclaiming.

Additionally change some CHECK to DCHECK and rearrange a bit the
code.

I didn't experience any regressions in my benchmarks.

Diff Detail

Event Timeline

cryptoad requested review of this revision.Dec 11 2020, 2:05 PM
cryptoad created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptDec 11 2020, 2:05 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
cryptoad updated this revision to Diff 311637.Dec 14 2020, 9:46 AM

Correct copy/paste error in the 32-bit primary (!= => ==)

cryptoad updated this revision to Diff 311646.Dec 14 2020, 10:25 AM

... and remove the unused field in the 32-bit primary. Sorry.

cferris accepted this revision.Dec 16 2020, 12:08 PM

I verified that this does not introduce any performance issues on Android.

Also, the code looks fine to me too.

This revision is now accepted and ready to land.Dec 16 2020, 12:08 PM

I forgot to mention this also tends to reduce RSS usage on some high usage dex2oat runs. Not all of them, but some saw a significant drop (from ~160MB to ~130MB).

This revision was landed with ongoing or failed builds.Dec 17 2020, 10:02 AM
This revision was automatically updated to reflect the committed changes.