This is an archive of the discontinued LLVM Phabricator instance.

[scudo][standalone] Shift some data from dynamic to static
ClosedPublic

Authored by cryptoad on Feb 16 2020, 3:30 PM.

Details

Summary

Most of our larger data is dynamically allocated (via map) but it
became an hindrance with regard to init time, for a cost to benefit
ratio that is not great. So change the TSDs, RegionInfo, ByteMap
to be static.

Additionally, for reclaiming, we used mapped & unmapped a buffer each
time, which is costly. It turns out that we can have a static buffer,
and that there isn't much contention on it.

One of the other things changed here, is that we hard set the number
of TSDs on Android to the maximum number, as there could be a
situation where cores are put to sleep and we could miss some.

Diff Detail

Event Timeline

cryptoad created this revision.Feb 16 2020, 3:30 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptFeb 16 2020, 3:30 PM
Herald added subscribers: llvm-commits, Restricted Project, mgorny. · View Herald Transcript
cryptoad updated this revision to Diff 244902.Feb 16 2020, 3:31 PM

Correcting a comment.

hctim accepted this revision.Feb 18 2020, 7:39 AM

LGTM w/ nits

compiler-rt/lib/scudo/standalone/bytemap.h
22

Nit: remove

compiler-rt/lib/scudo/standalone/release.h
42–43

Update?

72–78

nit: sizeof(StaticBuffer) should be a constant somewhere

This revision is now accepted and ready to land.Feb 18 2020, 7:39 AM
cryptoad updated this revision to Diff 245179.Feb 18 2020, 8:57 AM
cryptoad marked 3 inline comments as done.

Addressing the Mitch's comments.

This revision was automatically updated to reflect the committed changes.