[compiler-rt] 990acd4 - [scudo][standalone] Reduce Android region sizes to 128MB

Kostya Kortchinsky via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 22 09:42:46 PST 2020


Author: Kostya Kortchinsky
Date: 2020-01-22T09:42:07-08:00
New Revision: 990acd450cf198cc6a82a28e011fa602e44512ad

URL: https://github.com/llvm/llvm-project/commit/990acd450cf198cc6a82a28e011fa602e44512ad
DIFF: https://github.com/llvm/llvm-project/commit/990acd450cf198cc6a82a28e011fa602e44512ad.diff

LOG: [scudo][standalone] Reduce Android region sizes to 128MB

Summary:
Unity is making irresponsible assumptions as to how clumped up memory
should be. With larger regions, we break those, resulting in errors
like:

"Using memoryadresses from more that 16GB of memory"

This is unfortunately one of those situations where we have to bend to
existing code because we doubt it's going to change any time soon.

128MB should be enough, but we could be flirting with OOMs in the
higher class sizes.

Reviewers: cferris, eugenis, hctim, morehouse, pcc

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D73143

Added: 
    

Modified: 
    compiler-rt/lib/scudo/standalone/allocator_config.h

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/scudo/standalone/allocator_config.h b/compiler-rt/lib/scudo/standalone/allocator_config.h
index 39c962f4408c..1ad0405a181a 100644
--- a/compiler-rt/lib/scudo/standalone/allocator_config.h
+++ b/compiler-rt/lib/scudo/standalone/allocator_config.h
@@ -39,8 +39,8 @@ struct DefaultConfig {
 struct AndroidConfig {
   using SizeClassMap = AndroidSizeClassMap;
 #if SCUDO_CAN_USE_PRIMARY64
-  // 1GB regions
-  typedef SizeClassAllocator64<SizeClassMap, 30U,
+  // 128MB regions
+  typedef SizeClassAllocator64<SizeClassMap, 27U,
                                /*MaySupportMemoryTagging=*/true>
       Primary;
 #else
@@ -55,8 +55,8 @@ struct AndroidConfig {
 struct AndroidSvelteConfig {
   using SizeClassMap = SvelteSizeClassMap;
 #if SCUDO_CAN_USE_PRIMARY64
-  // 512MB regions
-  typedef SizeClassAllocator64<SizeClassMap, 29U> Primary;
+  // 128MB regions
+  typedef SizeClassAllocator64<SizeClassMap, 27U> Primary;
 #else
   // 64KB regions
   typedef SizeClassAllocator32<SizeClassMap, 16U> Primary;


        


More information about the llvm-commits mailing list