This is an archive of the discontinued LLVM Phabricator instance.

[scudo][standalone] 32-bit improvement
ClosedPublic

Authored by cryptoad on Feb 6 2020, 3:46 PM.

Details

Summary

This tweaks some behaviors of the allocator wrt 32-bit, notably
tailoring the size-class map.

I had to remove a printStats from __scudo_print_stats since when
within Bionic they share the same slot so they can't coexist at the
same time. I have to find a solution for that later, but right now we
are not using the Svelte configuration.

Diff Detail

Event Timeline

cryptoad created this revision.Feb 6 2020, 3:46 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
Herald added subscribers: llvm-commits, Restricted Project. · View Herald Transcript
pcc added a subscriber: pcc.Feb 6 2020, 4:18 PM
pcc added inline comments.
compiler-rt/lib/scudo/standalone/primary32.h
92

Typo?

261

Why remove this if? Looks like we never end up going from non-zero to zero in PossibleRegions so the only effect is that we end up setting MinRegionIndex/MaxRegionIndex to cover transfer batches which are ignored by iterateOverBlocks/releaseToOSMaybe anyway?

cryptoad updated this revision to Diff 243055.Feb 6 2020, 5:01 PM

Without extra `.

cryptoad updated this revision to Diff 243200.Feb 7 2020, 9:38 AM

Update the bytemap behavior to store ClassId + 1 instead of ClassId.
This allows to differentiate "unused" and "used-for-transferbatch".

cryptoad updated this revision to Diff 243221.Feb 7 2020, 10:17 AM

Further change the 32-bit size class map.

cryptoad marked 3 inline comments as done.Feb 7 2020, 10:20 AM
cryptoad added inline comments.
compiler-rt/lib/scudo/standalone/primary32.h
261

This was changed to allow releasing of the transfer batches (currently only via the "forced" release).
0 is now unused, which is different from the transfer batch class id.

pcc accepted this revision.Feb 7 2020, 10:37 AM

LGTM

This revision is now accepted and ready to land.Feb 7 2020, 10:37 AM
This revision was automatically updated to reflect the committed changes.
cryptoad marked an inline comment as done.