This is an archive of the discontinued LLVM Phabricator instance.

[scudo] Limit by default the TSD pool to 2 on Android
ClosedPublic

Authored by cryptoad on Jan 17 2018, 12:24 PM.

Details

Summary

jemalloc on Android currently uses 2 arenas
(https://android.googlesource.com/platform/external/jemalloc/+/master/Android.bp#64).
Since the Android toolchain absorbs compiler-rt and compiles it as is, we have
to enforce the same limit to somehow stay competitive in terms of memory usage.

The changes could either go in:

  • scudo_platform.h with a default for Android of 2 (this is the solution implemented here);
  • in CMakeLists.txt adding -DSCUDO_SHARED_TSD_POOL_SIZE=2 for Android.
  • something else?

I don't have a strong opinion on how to do it, but it has to be done upstream
anyway.

Diff Detail

Event Timeline

cryptoad created this revision.Jan 17 2018, 12:24 PM
Herald added subscribers: Restricted Project, srhines. · View Herald TranscriptJan 17 2018, 12:24 PM
alekseyshl accepted this revision.Jan 17 2018, 1:30 PM

Looks reasonable

This revision is now accepted and ready to land.Jan 17 2018, 1:30 PM
eugenis accepted this revision.Jan 17 2018, 1:35 PM
This revision was automatically updated to reflect the committed changes.