[compiler-rt] 6cb830d - [scudo][standalone] Revert some perf-degrading changes

Kostya Kortchinsky via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 29 14:01:03 PST 2020


Author: Kostya Kortchinsky
Date: 2020-01-29T14:00:48-08:00
New Revision: 6cb830de6e4f963f2e5e5f0aba23b2af3341e776

URL: https://github.com/llvm/llvm-project/commit/6cb830de6e4f963f2e5e5f0aba23b2af3341e776
DIFF: https://github.com/llvm/llvm-project/commit/6cb830de6e4f963f2e5e5f0aba23b2af3341e776.diff

LOG: [scudo][standalone] Revert some perf-degrading changes

Summary:
A couple of seemingly innocuous changes ended up having a large impact
on the 32-bit performance. I still have to make those configurable at
some point, but right now it will have to do.

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

Added: 
    

Modified: 
    compiler-rt/lib/scudo/standalone/primary32.h
    compiler-rt/lib/scudo/standalone/primary64.h

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/scudo/standalone/primary32.h b/compiler-rt/lib/scudo/standalone/primary32.h
index 6c80aad97444..62d798164daa 100644
--- a/compiler-rt/lib/scudo/standalone/primary32.h
+++ b/compiler-rt/lib/scudo/standalone/primary32.h
@@ -74,7 +74,8 @@ template <class SizeClassMapT, uptr RegionSizeLog> class SizeClassAllocator32 {
       Sci->RandState = getRandomU32(&Seed);
       // See comment in the 64-bit primary about releasing smaller size classes.
       Sci->CanRelease = (ReleaseToOsInterval >= 0) &&
-                        (getSizeByClassId(I) >= (PageSize / 64));
+                        (I != SizeClassMap::BatchClassId) &&
+                        (getSizeByClassId(I) >= (PageSize / 32));
     }
     ReleaseToOsIntervalMs = ReleaseToOsInterval;
   }

diff  --git a/compiler-rt/lib/scudo/standalone/primary64.h b/compiler-rt/lib/scudo/standalone/primary64.h
index d10f6e7909f0..5b83f0cf8f7d 100644
--- a/compiler-rt/lib/scudo/standalone/primary64.h
+++ b/compiler-rt/lib/scudo/standalone/primary64.h
@@ -87,7 +87,8 @@ class SizeClassAllocator64 {
       // limit is mostly arbitrary and based on empirical observations.
       // TODO(kostyak): make the lower limit a runtime option
       Region->CanRelease = (ReleaseToOsInterval >= 0) &&
-                           (getSizeByClassId(I) >= (PageSize / 64));
+                           (I != SizeClassMap::BatchClassId) &&
+                           (getSizeByClassId(I) >= (PageSize / 32));
       Region->RandState = getRandomU32(&Seed);
     }
     ReleaseToOsIntervalMs = ReleaseToOsInterval;


        


More information about the llvm-commits mailing list