[compiler-rt] [scudo] Fix the logic of MaxAllowedFragmentedPages (PR #107927)

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 10 15:56:01 PDT 2024


================
@@ -72,13 +72,16 @@ namespace {
 struct CachedBlock {
   static constexpr u16 CacheIndexMax = UINT16_MAX;
   static constexpr u16 InvalidEntry = CacheIndexMax;
-  //   * MaxReleasedCachePages default is currently 4
-  //        - We arrived at this value after noticing that mapping
-  //        in larger memory regions performs better than releasing
-  //        memory and forcing a cache hit. According to the data,
-  //        it suggests that beyond 4 pages, the release execution time is
-  //        longer than the map execution time. In this way, the default
-  //        is dependent on the platform.
+  // We allow a certain amount of fragmentation and part of the fragmented bytes
+  // will be released by `releaseAndZeroPagesToOS()`. This increases the chance
+  // of cache hit rate and reduce the overhead to the RSS at the same time. See
----------------
ChiaHungDuan wrote:

Done

https://github.com/llvm/llvm-project/pull/107927


More information about the llvm-commits mailing list