[scudo][standalone] Revert some perf-degrading changes
authorKostya Kortchinsky <kostyak@google.com>
Wed, 29 Jan 2020 20:35:44 +0000 (12:35 -0800)
committerKostya Kortchinsky <kostyak@google.com>
Wed, 29 Jan 2020 22:00:48 +0000 (14:00 -0800)
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

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

index 6c80aad..62d7981 100644 (file)
@@ -74,7 +74,8 @@ public:
       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;
   }
index d10f6e7..5b83f0c 100644 (file)
@@ -87,7 +87,8 @@ public:
       // 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;