This is an archive of the discontinued LLVM Phabricator instance.

[hwasan] Increase max allocation size to 1Tb.
ClosedPublic

Authored by eugenis on Oct 19 2020, 4:40 PM.

Details

Summary

2Gb is unreasonably low on devices with 12Gb RAM and more.

Diff Detail

Unit TestsFailed

Event Timeline

eugenis created this revision.Oct 19 2020, 4:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 19 2020, 4:40 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
eugenis requested review of this revision.Oct 19 2020, 4:40 PM

This costs 4 bytes per allocation.
We could save some memory by splitting primary and secondary allocator metadata types, but that would require significant code refactoring.

eugenis updated this revision to Diff 299220.Oct 19 2020, 4:47 PM

attribute((packed))

hctim accepted this revision.Oct 19 2020, 5:03 PM
This revision is now accepted and ready to land.Oct 19 2020, 5:03 PM
pcc added a comment.Oct 19 2020, 5:08 PM

Do we even need a limit at this level any more if the implementation supports up to 2^63 sizes? I guess any address-space imposed limit would be enforced by mmap failing when we go to make a large secondary allocation.

eugenis updated this revision to Diff 299227.Oct 19 2020, 5:14 PM

replaced attribute((packed)) with split storage

I think it's good to have a limit so that allocation attempts with obviously wrong sizes are rejected with a clear message.

pcc accepted this revision.Oct 19 2020, 5:21 PM

LGTM

I think it's good to have a limit so that allocation attempts with obviously wrong sizes are rejected with a clear message.

Okay, fair enough.

This revision was landed with ongoing or failed builds.Oct 20 2020, 2:02 PM
This revision was automatically updated to reflect the committed changes.