diff --git a/tcmalloc/BUILD b/tcmalloc/BUILD index cd6b4b520..574388e34 100644 --- a/tcmalloc/BUILD +++ b/tcmalloc/BUILD @@ -223,7 +223,6 @@ create_tcmalloc_libraries( "pagemap.h", "parameters.cc", "peak_heap_tracker.cc", - "reuse_relaxed_below_64_size_classes.cc", "sampler.cc", "sampler.h", "segv_handler.cc", diff --git a/tcmalloc/CMakeLists.txt b/tcmalloc/CMakeLists.txt index 4b7eb1d1b..e4098bb1f 100644 --- a/tcmalloc/CMakeLists.txt +++ b/tcmalloc/CMakeLists.txt @@ -278,7 +278,6 @@ tcmalloc_cc_library_variants( "pagemap.h" "parameters.cc" "peak_heap_tracker.cc" - "reuse_relaxed_below_64_size_classes.cc" "sampler.cc" "sampler.h" "segv_handler.cc" diff --git a/tcmalloc/cpu_cache.h b/tcmalloc/cpu_cache.h index 0c6882b3a..e7808d796 100644 --- a/tcmalloc/cpu_cache.h +++ b/tcmalloc/cpu_cache.h @@ -154,9 +154,7 @@ class StaticForwarder : private Parameters { bool reuse_size_classes() const { return state_.size_class_configuration() == - SizeClassConfiguration::kReuse || - state_.size_class_configuration() == - SizeClassConfiguration::kReuseRelaxedBelow64; + SizeClassConfiguration::kReuseRelaxedBelow64; } size_t class_to_size(int size_class) const { diff --git a/tcmalloc/global_stats.cc b/tcmalloc/global_stats.cc index a1725cb9f..1d8eda8a4 100644 --- a/tcmalloc/global_stats.cc +++ b/tcmalloc/global_stats.cc @@ -277,8 +277,6 @@ static absl::string_view SizeClassConfigurationString( case SizeClassConfiguration::kLegacy: // TODO(b/242710633): remove this opt out. return "SIZE_CLASS_LEGACY"; - case SizeClassConfiguration::kReuse: - return "SIZE_CLASS_REUSE"; case SizeClassConfiguration::kReuseRelaxedBelow64: return "SIZE_CLASS_REUSE_RELAXED_BELOW_64"; } diff --git a/tcmalloc/reuse_relaxed_below_64_size_classes.cc b/tcmalloc/reuse_relaxed_below_64_size_classes.cc deleted file mode 100644 index 8790fee1e..000000000 --- a/tcmalloc/reuse_relaxed_below_64_size_classes.cc +++ /dev/null @@ -1,522 +0,0 @@ -// Copyright 2019 The TCMalloc Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/types/span.h" -#include "tcmalloc/common.h" -#include "tcmalloc/internal/config.h" -#include "tcmalloc/internal/size_class_info.h" - -GOOGLE_MALLOC_SECTION_BEGIN -namespace tcmalloc { -namespace tcmalloc_internal { - -// Columns in the following tables: -// - bytes: size of the size class -// - span_bytes: number of bytes per span -// - batch: preferred number of objects for transfers between caches -// - class: size class number -// - objs: number of objects per span -// - waste/fixed: fixed per-size-class overhead due to end-of-span fragmentation -// and other factors. For instance, if we have a 96 byte size class, and use -// a single 8KiB page, then we will hold 85 objects per span, and have 32 -// bytes left over. There is also a fixed component of 64 bytes of TCMalloc -// metadata per span. Together, the fixed overhead would be wasted/allocated -// = (32 + 64) / (8192 - 32) ~= 1.2%. -// - waste/sampling: overhead due to heap sampling -// (rounding to page size, proxy object, metadata). -// - inc: increment from the previous size class. This caps the dynamic -// overhead component based on mismatches between the number of bytes -// requested and the number of bytes provided by the size class. Together -// they sum to the total overhead; for instance if you asked for a 50-byte -// allocation that rounds up to a 64-byte size class, the dynamic overhead -// would be 28%, and if waste were 22% it would mean (on average) 25 bytes -// of overhead for allocations of that size. - -// clang-format off -#if defined(__cpp_aligned_new) && __STDCPP_DEFAULT_NEW_ALIGNMENT__ <= 8 -#if TCMALLOC_PAGE_SHIFT == 13 -static_assert(kMaxSize == 262144, "kMaxSize mismatch"); -static constexpr SizeClassAssumptions Assumptions{ - .has_cold_classes = true, - .span_size = 64, - .sampling_interval = 2097152, - .large_size = 1024, - .large_size_alignment = 128, -}; -static constexpr SizeClassInfo List[] = { -// | waste | -// bytes span_bytes batch class objs | fixed sampling | inc - { 0, 0, 0}, // 0 0 0.00% 0.00% 0.00% - { 8, 8192, 32}, // 1 1024 0.78% 0.42% 0.00% - { 16, 8192, 32}, // 2 512 0.78% 0.42% 100.00% - { 24, 8192, 32}, // 3 341 0.87% 0.42% 50.00% - { 32, 8192, 32}, // 4 256 0.78% 0.42% 33.33% - { 48, 8192, 32}, // 5 170 1.16% 0.42% 50.00% - { 64, 8192, 32}, // 6 128 0.78% 0.42% 33.33% - { 80, 8192, 32}, // 7 102 1.16% 0.42% 25.00% - { 96, 8192, 32}, // 8 85 1.16% 0.42% 20.00% - { 112, 8192, 32}, // 9 73 0.97% 0.42% 16.67% - { 128, 8192, 32}, // 10 64 0.78% 0.42% 14.29% - { 160, 8192, 32}, // 11 51 1.16% 0.42% 25.00% - { 184, 8192, 32}, // 12 44 1.94% 0.42% 15.00% - { 208, 8192, 32}, // 13 39 1.74% 0.42% 13.04% - { 256, 8192, 32}, // 14 32 0.78% 0.42% 23.08% - { 312, 8192, 32}, // 15 26 1.74% 0.42% 21.88% - { 368, 8192, 32}, // 16 22 1.94% 0.42% 17.95% - { 448, 8192, 32}, // 17 18 2.33% 0.42% 21.74% - { 512, 8192, 32}, // 18 16 0.78% 0.42% 14.29% - { 576, 8192, 32}, // 19 14 2.33% 0.42% 12.50% - { 704, 8192, 32}, // 20 11 6.20% 0.43% 22.22% - { 896, 8192, 32}, // 21 9 2.33% 0.42% 27.27% - { 1024, 8192, 32}, // 22 8 0.78% 0.42% 14.29% - { 1152, 16384, 32}, // 23 14 1.95% 0.42% 12.50% - { 1408, 16384, 32}, // 24 11 5.84% 0.43% 22.22% - { 1792, 16384, 32}, // 25 9 1.95% 0.43% 27.27% - { 2048, 8192, 32}, // 26 4 0.78% 0.42% 14.29% - { 2304, 16384, 28}, // 27 7 1.95% 0.43% 12.50% - { 2688, 16384, 24}, // 28 6 1.95% 0.43% 16.67% - { 3456, 24576, 18}, // 29 7 1.82% 0.43% 28.57% - { 4096, 8192, 16}, // 30 2 0.78% 0.43% 18.52% - { 4736, 24576, 13}, // 31 5 3.90% 0.43% 15.62% - { 6144, 24576, 10}, // 32 4 0.26% 0.42% 29.73% - { 8192, 8192, 8}, // 33 1 0.78% 0.03% 33.33% - { 9472, 40960, 6}, // 34 4 7.64% 0.85% 15.62% - { 12288, 24576, 5}, // 35 2 0.26% 0.82% 29.73% - { 16384, 16384, 4}, // 36 1 0.39% 0.03% 33.33% - { 20480, 40960, 3}, // 37 2 0.16% 1.21% 25.00% - { 28672, 57344, 2}, // 38 2 0.11% 1.60% 40.00% - { 32768, 32768, 2}, // 39 1 0.19% 0.03% 14.29% - { 40960, 40960, 2}, // 40 1 0.16% 0.03% 25.00% - { 49152, 49152, 2}, // 41 1 0.13% 0.03% 20.00% - { 65536, 65536, 2}, // 42 1 0.10% 0.03% 33.33% - { 73728, 73728, 2}, // 43 1 0.09% 0.03% 12.50% - { 81920, 81920, 2}, // 44 1 0.08% 0.03% 11.11% - { 98304, 98304, 2}, // 45 1 0.07% 0.03% 20.00% - {131072, 131072, 2}, // 46 1 0.05% 0.03% 33.33% - {155648, 155648, 2}, // 47 1 0.04% 0.03% 18.75% - {204800, 204800, 2}, // 48 1 0.03% 0.03% 31.58% - {262144, 262144, 2}, // 49 1 0.02% 0.03% 28.00% -}; -#elif TCMALLOC_PAGE_SHIFT == 15 -static_assert(kMaxSize == 262144, "kMaxSize mismatch"); -static constexpr SizeClassAssumptions Assumptions{ - .has_cold_classes = true, - .span_size = 64, - .sampling_interval = 2097152, - .large_size = 1024, - .large_size_alignment = 128, -}; -static constexpr SizeClassInfo List[] = { -// | waste | -// bytes span_bytes batch class objs | fixed sampling | inc - { 0, 0, 0}, // 0 0 0.00% 0.00% 0.00% - { 8, 32768, 32}, // 1 4096 0.19% 1.60% 0.00% - { 16, 32768, 32}, // 2 2048 0.19% 1.60% 100.00% - { 24, 32768, 32}, // 3 1365 0.22% 1.60% 50.00% - { 32, 32768, 32}, // 4 1024 0.19% 1.60% 33.33% - { 48, 32768, 32}, // 5 682 0.29% 1.60% 50.00% - { 64, 32768, 32}, // 6 512 0.19% 1.60% 33.33% - { 80, 32768, 32}, // 7 409 0.34% 1.60% 25.00% - { 88, 32768, 32}, // 8 372 0.29% 1.60% 10.00% - { 112, 32768, 32}, // 9 292 0.39% 1.60% 27.27% - { 128, 32768, 32}, // 10 256 0.19% 1.60% 14.29% - { 160, 32768, 32}, // 11 204 0.58% 1.60% 25.00% - { 200, 32768, 32}, // 12 163 0.71% 1.60% 25.00% - { 256, 32768, 32}, // 13 128 0.19% 1.60% 28.00% - { 312, 32768, 32}, // 14 105 0.22% 1.60% 21.88% - { 376, 32768, 32}, // 15 87 0.37% 1.60% 20.51% - { 448, 32768, 32}, // 16 73 0.39% 1.60% 19.15% - { 512, 32768, 32}, // 17 64 0.19% 1.60% 14.29% - { 640, 32768, 32}, // 18 51 0.58% 1.60% 25.00% - { 832, 32768, 32}, // 19 39 1.17% 1.60% 30.00% - { 1024, 32768, 32}, // 20 32 0.19% 1.60% 23.08% - { 1152, 32768, 32}, // 21 28 1.75% 1.60% 12.50% - { 1280, 32768, 32}, // 22 25 2.53% 1.60% 11.11% - { 1536, 32768, 32}, // 23 21 1.75% 1.60% 20.00% - { 2048, 32768, 32}, // 24 16 0.19% 1.60% 33.33% - { 2304, 32768, 28}, // 25 14 1.75% 1.60% 12.50% - { 2688, 32768, 24}, // 26 12 1.75% 1.60% 16.67% - { 3200, 32768, 20}, // 27 10 2.53% 1.60% 19.05% - { 4096, 32768, 16}, // 28 8 0.19% 1.60% 28.00% - { 4608, 32768, 14}, // 29 7 1.75% 1.60% 12.50% - { 5376, 32768, 12}, // 30 6 1.75% 1.60% 16.67% - { 6528, 32768, 10}, // 31 5 0.58% 1.60% 21.43% - { 8192, 32768, 8}, // 32 4 0.19% 1.60% 25.49% - { 9344, 65536, 7}, // 33 7 0.29% 1.60% 14.06% - { 13056, 65536, 5}, // 34 5 0.49% 1.60% 39.73% - { 16384, 32768, 4}, // 35 2 0.19% 1.60% 25.49% - { 21760, 65536, 3}, // 36 3 0.49% 1.60% 32.81% - { 28032, 196608, 2}, // 37 7 0.23% 1.60% 28.82% - { 32768, 32768, 2}, // 38 1 0.19% 0.03% 16.89% - { 40960, 131072, 2}, // 39 3 6.30% 3.28% 25.00% - { 54528, 163840, 2}, // 40 3 0.20% 3.16% 33.12% - { 65536, 65536, 2}, // 41 1 0.10% 0.03% 20.19% - { 81920, 163840, 2}, // 42 2 0.04% 4.72% 25.00% - {114688, 229376, 2}, // 43 2 0.03% 6.28% 40.00% - {131072, 131072, 2}, // 44 1 0.05% 0.03% 14.29% - {163840, 163840, 2}, // 45 1 0.04% 0.03% 25.00% - {229376, 229376, 2}, // 46 1 0.03% 0.03% 40.00% - {262144, 262144, 2}, // 47 1 0.02% 0.03% 14.29% -}; -#elif TCMALLOC_PAGE_SHIFT == 18 -static_assert(kMaxSize == 262144, "kMaxSize mismatch"); -static constexpr SizeClassAssumptions Assumptions{ - .has_cold_classes = true, - .span_size = 64, - .sampling_interval = 2097152, - .large_size = 1024, - .large_size_alignment = 128, -}; -static constexpr SizeClassInfo List[] = { -// | waste | -// bytes span_bytes batch class objs | fixed sampling | inc - { 0, 0, 0}, // 0 0 0.00% 0.00% 0.00% - { 8, 262144, 32}, // 1 32768 0.02% 12.53% 0.00% - { 16, 262144, 32}, // 2 16384 0.02% 12.53% 100.00% - { 24, 262144, 32}, // 3 10922 0.03% 12.53% 50.00% - { 32, 262144, 32}, // 4 8192 0.02% 12.53% 33.33% - { 48, 262144, 32}, // 5 5461 0.03% 12.53% 50.00% - { 64, 262144, 32}, // 6 4096 0.02% 12.53% 33.33% - { 80, 262144, 32}, // 7 3276 0.05% 12.53% 25.00% - { 96, 262144, 32}, // 8 2730 0.05% 12.53% 20.00% - { 112, 262144, 32}, // 9 2340 0.05% 12.53% 16.67% - { 128, 262144, 32}, // 10 2048 0.02% 12.53% 14.29% - { 152, 262144, 32}, // 11 1724 0.06% 12.53% 18.75% - { 192, 262144, 32}, // 12 1365 0.05% 12.53% 26.32% - { 256, 262144, 32}, // 13 1024 0.02% 12.53% 33.33% - { 304, 262144, 32}, // 14 862 0.06% 12.53% 18.75% - { 384, 262144, 32}, // 15 682 0.12% 12.53% 26.32% - { 448, 262144, 32}, // 16 585 0.05% 12.53% 16.67% - { 512, 262144, 32}, // 17 512 0.02% 12.53% 14.29% - { 640, 262144, 32}, // 18 409 0.17% 12.53% 25.00% - { 768, 262144, 32}, // 19 341 0.12% 12.53% 20.00% - { 832, 262144, 32}, // 20 315 0.05% 12.53% 8.33% - { 1024, 262144, 32}, // 21 256 0.02% 12.53% 23.08% - { 1280, 262144, 32}, // 22 204 0.41% 12.53% 25.00% - { 1664, 262144, 32}, // 23 157 0.37% 12.53% 30.00% - { 2048, 262144, 32}, // 24 128 0.02% 12.53% 23.08% - { 2560, 262144, 25}, // 25 102 0.41% 12.53% 25.00% - { 3200, 262144, 20}, // 26 81 1.15% 12.53% 25.00% - { 4096, 262144, 16}, // 27 64 0.02% 12.53% 28.00% - { 4480, 262144, 14}, // 28 58 0.90% 12.54% 9.38% - { 5120, 262144, 12}, // 29 51 0.41% 12.53% 14.29% - { 6528, 262144, 10}, // 30 40 0.41% 12.53% 27.50% - { 8192, 262144, 8}, // 31 32 0.02% 12.53% 25.49% - { 9600, 262144, 6}, // 32 27 1.15% 12.54% 17.19% - { 11392, 262144, 5}, // 33 23 0.07% 12.53% 18.67% - { 13056, 262144, 5}, // 34 20 0.41% 12.54% 14.61% - { 16384, 262144, 4}, // 35 16 0.02% 12.53% 25.49% - { 21760, 262144, 3}, // 36 12 0.41% 12.54% 32.81% - { 26112, 262144, 2}, // 37 10 0.41% 12.54% 20.00% - { 29056, 262144, 2}, // 38 9 0.27% 12.54% 11.27% - { 32768, 262144, 2}, // 39 8 0.02% 12.53% 12.78% - { 37376, 262144, 2}, // 40 7 0.22% 12.54% 14.06% - { 43648, 262144, 2}, // 41 6 0.12% 12.54% 16.78% - { 52352, 262144, 2}, // 42 5 0.17% 12.54% 19.94% - { 65536, 262144, 2}, // 43 4 0.02% 12.53% 25.18% - { 74880, 524288, 2}, // 44 7 0.04% 12.53% 14.26% - { 87296, 262144, 2}, // 45 3 0.12% 12.54% 16.58% - {104832, 524288, 2}, // 46 5 0.04% 12.54% 20.09% - {131072, 262144, 2}, // 47 2 0.02% 12.53% 25.03% - {174720, 524288, 2}, // 48 3 0.04% 12.54% 33.30% - {209664, 1048576, 2}, // 49 5 0.03% 12.54% 20.00% - {262144, 262144, 2}, // 50 1 0.02% 0.03% 25.03% -}; -#elif TCMALLOC_PAGE_SHIFT == 12 -static_assert(kMaxSize == 8192, "kMaxSize mismatch"); -static constexpr SizeClassAssumptions Assumptions{ - .has_cold_classes = false, - .span_size = 64, - .sampling_interval = 2097152, - .large_size = 1024, - .large_size_alignment = 128, -}; -static constexpr SizeClassInfo List[] = { -// | waste | -// bytes span_bytes batch class objs | fixed sampling | inc - { 0, 0, 0}, // 0 0 0.00% 0.00% 0.00% - { 8, 4096, 32}, // 1 512 1.54% 0.23% 0.00% - { 16, 4096, 32}, // 2 256 1.54% 0.23% 100.00% - { 24, 4096, 32}, // 3 170 1.92% 0.23% 50.00% - { 32, 4096, 32}, // 4 128 1.54% 0.23% 33.33% - { 48, 4096, 32}, // 5 85 1.92% 0.23% 50.00% - { 64, 4096, 32}, // 6 64 1.54% 0.23% 33.33% - { 80, 4096, 32}, // 7 51 1.92% 0.23% 25.00% - { 96, 4096, 32}, // 8 42 3.08% 0.23% 20.00% - { 128, 4096, 32}, // 9 32 1.54% 0.23% 33.33% - { 160, 4096, 32}, // 10 25 3.85% 0.23% 25.00% - { 224, 4096, 32}, // 11 18 3.08% 0.23% 40.00% - { 256, 4096, 32}, // 12 16 1.54% 0.23% 14.29% - { 288, 4096, 32}, // 13 14 3.08% 0.23% 12.50% - { 368, 4096, 32}, // 14 11 2.69% 0.23% 27.78% - { 512, 4096, 32}, // 15 8 1.54% 0.23% 39.13% - { 576, 8192, 32}, // 16 14 2.33% 0.23% 12.50% - { 768, 8192, 32}, // 17 10 6.98% 0.23% 33.33% - { 1024, 8192, 32}, // 18 8 0.78% 0.23% 33.33% - { 1536, 12288, 32}, // 19 8 0.52% 0.23% 50.00% - { 2048, 16384, 32}, // 20 8 0.39% 0.23% 33.33% - { 2688, 16384, 24}, // 21 6 1.95% 0.23% 31.25% - { 4096, 16384, 16}, // 22 4 0.39% 0.23% 52.38% - { 4736, 20480, 13}, // 23 4 7.79% 0.44% 15.62% - { 6144, 12288, 10}, // 24 2 0.52% 0.43% 29.73% - { 8192, 16384, 8}, // 25 2 0.39% 0.43% 33.33% -}; -#else -#error "Unsupported TCMALLOC_PAGE_SHIFT value!" -#endif -#else -#if TCMALLOC_PAGE_SHIFT == 13 -static_assert(kMaxSize == 262144, "kMaxSize mismatch"); -static constexpr SizeClassAssumptions Assumptions{ - .has_cold_classes = true, - .span_size = 64, - .sampling_interval = 2097152, - .large_size = 1024, - .large_size_alignment = 128, -}; -static constexpr SizeClassInfo List[] = { -// | waste | -// bytes span_bytes batch class objs | fixed sampling | inc - { 0, 0, 0}, // 0 0 0.00% 0.00% 0.00% - { 8, 8192, 32}, // 1 1024 0.78% 0.42% 0.00% - { 16, 8192, 32}, // 2 512 0.78% 0.42% 100.00% - { 32, 8192, 32}, // 3 256 0.78% 0.42% 100.00% - { 48, 8192, 32}, // 4 170 1.16% 0.42% 50.00% - { 64, 8192, 32}, // 5 128 0.78% 0.42% 33.33% - { 80, 8192, 32}, // 6 102 1.16% 0.42% 25.00% - { 96, 8192, 32}, // 7 85 1.16% 0.42% 20.00% - { 112, 8192, 32}, // 8 73 0.97% 0.42% 16.67% - { 128, 8192, 32}, // 9 64 0.78% 0.42% 14.29% - { 160, 8192, 32}, // 10 51 1.16% 0.42% 25.00% - { 176, 8192, 32}, // 11 46 1.94% 0.42% 10.00% - { 208, 8192, 32}, // 12 39 1.74% 0.42% 18.18% - { 256, 8192, 32}, // 13 32 0.78% 0.42% 23.08% - { 304, 8192, 32}, // 14 26 4.26% 0.42% 18.75% - { 368, 8192, 32}, // 15 22 1.94% 0.42% 21.05% - { 448, 8192, 32}, // 16 18 2.33% 0.42% 21.74% - { 512, 8192, 32}, // 17 16 0.78% 0.42% 14.29% - { 576, 8192, 32}, // 18 14 2.33% 0.42% 12.50% - { 704, 8192, 32}, // 19 11 6.20% 0.43% 22.22% - { 896, 8192, 32}, // 20 9 2.33% 0.42% 27.27% - { 1024, 8192, 32}, // 21 8 0.78% 0.42% 14.29% - { 1152, 16384, 32}, // 22 14 1.95% 0.42% 12.50% - { 1408, 16384, 32}, // 23 11 5.84% 0.43% 22.22% - { 1792, 16384, 32}, // 24 9 1.95% 0.43% 27.27% - { 2048, 8192, 32}, // 25 4 0.78% 0.42% 14.29% - { 2304, 16384, 28}, // 26 7 1.95% 0.43% 12.50% - { 2688, 16384, 24}, // 27 6 1.95% 0.43% 16.67% - { 3456, 24576, 18}, // 28 7 1.82% 0.43% 28.57% - { 4096, 8192, 16}, // 29 2 0.78% 0.43% 18.52% - { 4736, 24576, 13}, // 30 5 3.90% 0.43% 15.62% - { 6144, 24576, 10}, // 31 4 0.26% 0.42% 29.73% - { 8192, 8192, 8}, // 32 1 0.78% 0.03% 33.33% - { 9472, 40960, 6}, // 33 4 7.64% 0.85% 15.62% - { 12288, 24576, 5}, // 34 2 0.26% 0.82% 29.73% - { 16384, 16384, 4}, // 35 1 0.39% 0.03% 33.33% - { 20480, 40960, 3}, // 36 2 0.16% 1.21% 25.00% - { 28672, 57344, 2}, // 37 2 0.11% 1.60% 40.00% - { 32768, 32768, 2}, // 38 1 0.19% 0.03% 14.29% - { 40960, 40960, 2}, // 39 1 0.16% 0.03% 25.00% - { 49152, 49152, 2}, // 40 1 0.13% 0.03% 20.00% - { 65536, 65536, 2}, // 41 1 0.10% 0.03% 33.33% - { 73728, 73728, 2}, // 42 1 0.09% 0.03% 12.50% - { 81920, 81920, 2}, // 43 1 0.08% 0.03% 11.11% - { 98304, 98304, 2}, // 44 1 0.07% 0.03% 20.00% - {131072, 131072, 2}, // 45 1 0.05% 0.03% 33.33% - {155648, 155648, 2}, // 46 1 0.04% 0.03% 18.75% - {204800, 204800, 2}, // 47 1 0.03% 0.03% 31.58% - {262144, 262144, 2}, // 48 1 0.02% 0.03% 28.00% -}; -#elif TCMALLOC_PAGE_SHIFT == 15 -static_assert(kMaxSize == 262144, "kMaxSize mismatch"); -static constexpr SizeClassAssumptions Assumptions{ - .has_cold_classes = true, - .span_size = 64, - .sampling_interval = 2097152, - .large_size = 1024, - .large_size_alignment = 128, -}; -static constexpr SizeClassInfo List[] = { -// | waste | -// bytes span_bytes batch class objs | fixed sampling | inc - { 0, 0, 0}, // 0 0 0.00% 0.00% 0.00% - { 8, 32768, 32}, // 1 4096 0.19% 1.60% 0.00% - { 16, 32768, 32}, // 2 2048 0.19% 1.60% 100.00% - { 32, 32768, 32}, // 3 1024 0.19% 1.60% 100.00% - { 48, 32768, 32}, // 4 682 0.29% 1.60% 50.00% - { 64, 32768, 32}, // 5 512 0.19% 1.60% 33.33% - { 80, 32768, 32}, // 6 409 0.34% 1.60% 25.00% - { 96, 32768, 32}, // 7 341 0.29% 1.60% 20.00% - { 112, 32768, 32}, // 8 292 0.39% 1.60% 16.67% - { 128, 32768, 32}, // 9 256 0.19% 1.60% 14.29% - { 160, 32768, 32}, // 10 204 0.58% 1.60% 25.00% - { 192, 32768, 32}, // 11 170 0.58% 1.60% 20.00% - { 256, 32768, 32}, // 12 128 0.19% 1.60% 33.33% - { 320, 32768, 32}, // 13 102 0.58% 1.60% 25.00% - { 384, 32768, 32}, // 14 85 0.58% 1.60% 20.00% - { 448, 32768, 32}, // 15 73 0.39% 1.60% 16.67% - { 512, 32768, 32}, // 16 64 0.19% 1.60% 14.29% - { 640, 32768, 32}, // 17 51 0.58% 1.60% 25.00% - { 832, 32768, 32}, // 18 39 1.17% 1.60% 30.00% - { 1024, 32768, 32}, // 19 32 0.19% 1.60% 23.08% - { 1152, 32768, 32}, // 20 28 1.75% 1.60% 12.50% - { 1280, 32768, 32}, // 21 25 2.53% 1.60% 11.11% - { 1536, 32768, 32}, // 22 21 1.75% 1.60% 20.00% - { 2048, 32768, 32}, // 23 16 0.19% 1.60% 33.33% - { 2304, 32768, 28}, // 24 14 1.75% 1.60% 12.50% - { 2688, 32768, 24}, // 25 12 1.75% 1.60% 16.67% - { 3200, 32768, 20}, // 26 10 2.53% 1.60% 19.05% - { 4096, 32768, 16}, // 27 8 0.19% 1.60% 28.00% - { 4608, 32768, 14}, // 28 7 1.75% 1.60% 12.50% - { 5376, 32768, 12}, // 29 6 1.75% 1.60% 16.67% - { 6528, 32768, 10}, // 30 5 0.58% 1.60% 21.43% - { 8192, 32768, 8}, // 31 4 0.19% 1.60% 25.49% - { 9344, 65536, 7}, // 32 7 0.29% 1.60% 14.06% - { 13056, 65536, 5}, // 33 5 0.49% 1.60% 39.73% - { 16384, 32768, 4}, // 34 2 0.19% 1.60% 25.49% - { 21760, 65536, 3}, // 35 3 0.49% 1.60% 32.81% - { 28032, 196608, 2}, // 36 7 0.23% 1.60% 28.82% - { 32768, 32768, 2}, // 37 1 0.19% 0.03% 16.89% - { 38144, 163840, 2}, // 38 4 6.91% 3.28% 16.41% - { 49152, 98304, 2}, // 39 2 0.07% 3.16% 28.86% - { 57344, 229376, 2}, // 40 4 0.03% 3.16% 16.67% - { 65536, 65536, 2}, // 41 1 0.10% 0.03% 14.29% - { 81920, 163840, 2}, // 42 2 0.04% 4.72% 25.00% - {114688, 229376, 2}, // 43 2 0.03% 6.28% 40.00% - {131072, 131072, 2}, // 44 1 0.05% 0.03% 14.29% - {163840, 163840, 2}, // 45 1 0.04% 0.03% 25.00% - {229376, 229376, 2}, // 46 1 0.03% 0.03% 40.00% - {262144, 262144, 2}, // 47 1 0.02% 0.03% 14.29% -}; -#elif TCMALLOC_PAGE_SHIFT == 18 -static_assert(kMaxSize == 262144, "kMaxSize mismatch"); -static constexpr SizeClassAssumptions Assumptions{ - .has_cold_classes = true, - .span_size = 64, - .sampling_interval = 2097152, - .large_size = 1024, - .large_size_alignment = 128, -}; -static constexpr SizeClassInfo List[] = { -// | waste | -// bytes span_bytes batch class objs | fixed sampling | inc - { 0, 0, 0}, // 0 0 0.00% 0.00% 0.00% - { 8, 262144, 32}, // 1 32768 0.02% 12.53% 0.00% - { 16, 262144, 32}, // 2 16384 0.02% 12.53% 100.00% - { 32, 262144, 32}, // 3 8192 0.02% 12.53% 100.00% - { 48, 262144, 32}, // 4 5461 0.03% 12.53% 50.00% - { 64, 262144, 32}, // 5 4096 0.02% 12.53% 33.33% - { 80, 262144, 32}, // 6 3276 0.05% 12.53% 25.00% - { 96, 262144, 32}, // 7 2730 0.05% 12.53% 20.00% - { 112, 262144, 32}, // 8 2340 0.05% 12.53% 16.67% - { 128, 262144, 32}, // 9 2048 0.02% 12.53% 14.29% - { 160, 262144, 32}, // 10 1638 0.05% 12.53% 25.00% - { 192, 262144, 32}, // 11 1365 0.05% 12.53% 20.00% - { 256, 262144, 32}, // 12 1024 0.02% 12.53% 33.33% - { 304, 262144, 32}, // 13 862 0.06% 12.53% 18.75% - { 384, 262144, 32}, // 14 682 0.12% 12.53% 26.32% - { 448, 262144, 32}, // 15 585 0.05% 12.53% 16.67% - { 512, 262144, 32}, // 16 512 0.02% 12.53% 14.29% - { 640, 262144, 32}, // 17 409 0.17% 12.53% 25.00% - { 768, 262144, 32}, // 18 341 0.12% 12.53% 20.00% - { 832, 262144, 32}, // 19 315 0.05% 12.53% 8.33% - { 1024, 262144, 32}, // 20 256 0.02% 12.53% 23.08% - { 1280, 262144, 32}, // 21 204 0.41% 12.53% 25.00% - { 1664, 262144, 32}, // 22 157 0.37% 12.53% 30.00% - { 2048, 262144, 32}, // 23 128 0.02% 12.53% 23.08% - { 2560, 262144, 25}, // 24 102 0.41% 12.53% 25.00% - { 3200, 262144, 20}, // 25 81 1.15% 12.53% 25.00% - { 4096, 262144, 16}, // 26 64 0.02% 12.53% 28.00% - { 4480, 262144, 14}, // 27 58 0.90% 12.54% 9.38% - { 5120, 262144, 12}, // 28 51 0.41% 12.53% 14.29% - { 6528, 262144, 10}, // 29 40 0.41% 12.53% 27.50% - { 8192, 262144, 8}, // 30 32 0.02% 12.53% 25.49% - { 9600, 262144, 6}, // 31 27 1.15% 12.54% 17.19% - { 11392, 262144, 5}, // 32 23 0.07% 12.53% 18.67% - { 13056, 262144, 5}, // 33 20 0.41% 12.54% 14.61% - { 16384, 262144, 4}, // 34 16 0.02% 12.53% 25.49% - { 21760, 262144, 3}, // 35 12 0.41% 12.54% 32.81% - { 26112, 262144, 2}, // 36 10 0.41% 12.54% 20.00% - { 29056, 262144, 2}, // 37 9 0.27% 12.54% 11.27% - { 32768, 262144, 2}, // 38 8 0.02% 12.53% 12.78% - { 37376, 262144, 2}, // 39 7 0.22% 12.54% 14.06% - { 43648, 262144, 2}, // 40 6 0.12% 12.54% 16.78% - { 52352, 262144, 2}, // 41 5 0.17% 12.54% 19.94% - { 65536, 262144, 2}, // 42 4 0.02% 12.53% 25.18% - { 74880, 524288, 2}, // 43 7 0.04% 12.53% 14.26% - { 87296, 262144, 2}, // 44 3 0.12% 12.54% 16.58% - {104832, 524288, 2}, // 45 5 0.04% 12.54% 20.09% - {131072, 262144, 2}, // 46 2 0.02% 12.53% 25.03% - {149760, 786432, 2}, // 47 5 4.79% 12.88% 14.26% - {174720, 524288, 2}, // 48 3 0.04% 12.54% 16.67% - {209664, 1048576, 2}, // 49 5 0.03% 12.54% 20.00% - {262144, 262144, 2}, // 50 1 0.02% 0.03% 25.03% -}; -#elif TCMALLOC_PAGE_SHIFT == 12 -static_assert(kMaxSize == 8192, "kMaxSize mismatch"); -static constexpr SizeClassAssumptions Assumptions{ - .has_cold_classes = false, - .span_size = 64, - .sampling_interval = 2097152, - .large_size = 1024, - .large_size_alignment = 128, -}; -static constexpr SizeClassInfo List[] = { -// | waste | -// bytes span_bytes batch class objs | fixed sampling | inc - { 0, 0, 0}, // 0 0 0.00% 0.00% 0.00% - { 8, 4096, 32}, // 1 512 1.54% 0.23% 0.00% - { 16, 4096, 32}, // 2 256 1.54% 0.23% 100.00% - { 32, 4096, 32}, // 3 128 1.54% 0.23% 100.00% - { 48, 4096, 32}, // 4 85 1.92% 0.23% 50.00% - { 64, 4096, 32}, // 5 64 1.54% 0.23% 33.33% - { 80, 4096, 32}, // 6 51 1.92% 0.23% 25.00% - { 96, 4096, 32}, // 7 42 3.08% 0.23% 20.00% - { 128, 4096, 32}, // 8 32 1.54% 0.23% 33.33% - { 144, 4096, 32}, // 9 28 3.08% 0.23% 12.50% - { 160, 4096, 32}, // 10 25 3.85% 0.23% 11.11% - { 224, 4096, 32}, // 11 18 3.08% 0.23% 40.00% - { 256, 4096, 32}, // 12 16 1.54% 0.23% 14.29% - { 288, 4096, 32}, // 13 14 3.08% 0.23% 12.50% - { 368, 4096, 32}, // 14 11 2.69% 0.23% 27.78% - { 512, 4096, 32}, // 15 8 1.54% 0.23% 39.13% - { 576, 8192, 32}, // 16 14 2.33% 0.23% 12.50% - { 768, 8192, 32}, // 17 10 6.98% 0.23% 33.33% - { 1024, 8192, 32}, // 18 8 0.78% 0.23% 33.33% - { 1536, 12288, 32}, // 19 8 0.52% 0.23% 50.00% - { 2048, 16384, 32}, // 20 8 0.39% 0.23% 33.33% - { 2688, 16384, 24}, // 21 6 1.95% 0.23% 31.25% - { 4096, 16384, 16}, // 22 4 0.39% 0.23% 52.38% - { 4736, 20480, 13}, // 23 4 7.79% 0.44% 15.62% - { 6144, 12288, 10}, // 24 2 0.52% 0.43% 29.73% - { 8192, 16384, 8}, // 25 2 0.39% 0.43% 33.33% -}; -#else -#error "Unsupported TCMALLOC_PAGE_SHIFT value!" -#endif -#endif -// clang-format on - -static_assert(sizeof(List) / sizeof(List[0]) <= kNumBaseClasses); -extern constexpr SizeClasses kReuseRelaxedBelow64SizeClasses{List, Assumptions}; - -// clang-format off -static_assert(SizeClassesAreDivisibleByPageSize( - kReuseRelaxedBelow64SizeClasses.classes, Bytes(kPageSize)), - "size classes must be divisible by page size"); -// clang-format on - -} // namespace tcmalloc_internal -} // namespace tcmalloc -GOOGLE_MALLOC_SECTION_END diff --git a/tcmalloc/size_classes.cc b/tcmalloc/size_classes.cc index 9999ce3ab..8fda919d8 100644 --- a/tcmalloc/size_classes.cc +++ b/tcmalloc/size_classes.cc @@ -60,51 +60,53 @@ static constexpr SizeClassInfo List[] = { { 0, 0, 0}, // 0 0 0.00% 0.00% 0.00% { 8, 8192, 32}, // 1 1024 0.78% 0.42% 0.00% { 16, 8192, 32}, // 2 512 0.78% 0.42% 100.00% - { 32, 8192, 32}, // 3 256 0.78% 0.42% 100.00% - { 64, 8192, 32}, // 4 128 0.78% 0.42% 100.00% - { 80, 8192, 32}, // 5 102 1.16% 0.42% 25.00% - { 96, 8192, 32}, // 6 85 1.16% 0.42% 20.00% - { 112, 8192, 32}, // 7 73 0.97% 0.42% 16.67% - { 128, 8192, 32}, // 8 64 0.78% 0.42% 14.29% - { 160, 8192, 32}, // 9 51 1.16% 0.42% 25.00% - { 184, 8192, 32}, // 10 44 1.94% 0.42% 15.00% - { 208, 8192, 32}, // 11 39 1.74% 0.42% 13.04% - { 256, 8192, 32}, // 12 32 0.78% 0.42% 23.08% - { 312, 8192, 32}, // 13 26 1.74% 0.42% 21.88% - { 368, 8192, 32}, // 14 22 1.94% 0.42% 17.95% - { 448, 8192, 32}, // 15 18 2.33% 0.42% 21.74% - { 512, 8192, 32}, // 16 16 0.78% 0.42% 14.29% - { 576, 8192, 32}, // 17 14 2.33% 0.42% 12.50% - { 704, 8192, 32}, // 18 11 6.20% 0.43% 22.22% - { 896, 8192, 32}, // 19 9 2.33% 0.42% 27.27% - { 1024, 8192, 32}, // 20 8 0.78% 0.42% 14.29% - { 1152, 16384, 32}, // 21 14 1.95% 0.42% 12.50% - { 1408, 16384, 32}, // 22 11 5.84% 0.43% 22.22% - { 1792, 16384, 32}, // 23 9 1.95% 0.43% 27.27% - { 2048, 8192, 32}, // 24 4 0.78% 0.42% 14.29% - { 2304, 16384, 28}, // 25 7 1.95% 0.43% 12.50% - { 2688, 16384, 24}, // 26 6 1.95% 0.43% 16.67% - { 3456, 24576, 18}, // 27 7 1.82% 0.43% 28.57% - { 4096, 8192, 16}, // 28 2 0.78% 0.43% 18.52% - { 4736, 24576, 13}, // 29 5 3.90% 0.43% 15.62% - { 6144, 24576, 10}, // 30 4 0.26% 0.42% 29.73% - { 8192, 8192, 8}, // 31 1 0.78% 0.03% 33.33% - { 9472, 40960, 6}, // 32 4 7.64% 0.85% 15.62% - { 12288, 24576, 5}, // 33 2 0.26% 0.82% 29.73% - { 16384, 16384, 4}, // 34 1 0.39% 0.03% 33.33% - { 20480, 40960, 3}, // 35 2 0.16% 1.21% 25.00% - { 28672, 57344, 2}, // 36 2 0.11% 1.60% 40.00% - { 32768, 32768, 2}, // 37 1 0.19% 0.03% 14.29% - { 40960, 40960, 2}, // 38 1 0.16% 0.03% 25.00% - { 49152, 49152, 2}, // 39 1 0.13% 0.03% 20.00% - { 65536, 65536, 2}, // 40 1 0.10% 0.03% 33.33% - { 73728, 73728, 2}, // 41 1 0.09% 0.03% 12.50% - { 81920, 81920, 2}, // 42 1 0.08% 0.03% 11.11% - { 98304, 98304, 2}, // 43 1 0.07% 0.03% 20.00% - {131072, 131072, 2}, // 44 1 0.05% 0.03% 33.33% - {155648, 155648, 2}, // 45 1 0.04% 0.03% 18.75% - {204800, 204800, 2}, // 46 1 0.03% 0.03% 31.58% - {262144, 262144, 2}, // 47 1 0.02% 0.03% 28.00% + { 24, 8192, 32}, // 3 341 0.87% 0.42% 50.00% + { 32, 8192, 32}, // 4 256 0.78% 0.42% 33.33% + { 48, 8192, 32}, // 5 170 1.16% 0.42% 50.00% + { 64, 8192, 32}, // 6 128 0.78% 0.42% 33.33% + { 80, 8192, 32}, // 7 102 1.16% 0.42% 25.00% + { 96, 8192, 32}, // 8 85 1.16% 0.42% 20.00% + { 112, 8192, 32}, // 9 73 0.97% 0.42% 16.67% + { 128, 8192, 32}, // 10 64 0.78% 0.42% 14.29% + { 160, 8192, 32}, // 11 51 1.16% 0.42% 25.00% + { 184, 8192, 32}, // 12 44 1.94% 0.42% 15.00% + { 208, 8192, 32}, // 13 39 1.74% 0.42% 13.04% + { 256, 8192, 32}, // 14 32 0.78% 0.42% 23.08% + { 312, 8192, 32}, // 15 26 1.74% 0.42% 21.88% + { 368, 8192, 32}, // 16 22 1.94% 0.42% 17.95% + { 448, 8192, 32}, // 17 18 2.33% 0.42% 21.74% + { 512, 8192, 32}, // 18 16 0.78% 0.42% 14.29% + { 576, 8192, 32}, // 19 14 2.33% 0.42% 12.50% + { 704, 8192, 32}, // 20 11 6.20% 0.43% 22.22% + { 896, 8192, 32}, // 21 9 2.33% 0.42% 27.27% + { 1024, 8192, 32}, // 22 8 0.78% 0.42% 14.29% + { 1152, 16384, 32}, // 23 14 1.95% 0.42% 12.50% + { 1408, 16384, 32}, // 24 11 5.84% 0.43% 22.22% + { 1792, 16384, 32}, // 25 9 1.95% 0.43% 27.27% + { 2048, 8192, 32}, // 26 4 0.78% 0.42% 14.29% + { 2304, 16384, 28}, // 27 7 1.95% 0.43% 12.50% + { 2688, 16384, 24}, // 28 6 1.95% 0.43% 16.67% + { 3456, 24576, 18}, // 29 7 1.82% 0.43% 28.57% + { 4096, 8192, 16}, // 30 2 0.78% 0.43% 18.52% + { 4736, 24576, 13}, // 31 5 3.90% 0.43% 15.62% + { 6144, 24576, 10}, // 32 4 0.26% 0.42% 29.73% + { 8192, 8192, 8}, // 33 1 0.78% 0.03% 33.33% + { 9472, 40960, 6}, // 34 4 7.64% 0.85% 15.62% + { 12288, 24576, 5}, // 35 2 0.26% 0.82% 29.73% + { 16384, 16384, 4}, // 36 1 0.39% 0.03% 33.33% + { 20480, 40960, 3}, // 37 2 0.16% 1.21% 25.00% + { 28672, 57344, 2}, // 38 2 0.11% 1.60% 40.00% + { 32768, 32768, 2}, // 39 1 0.19% 0.03% 14.29% + { 40960, 40960, 2}, // 40 1 0.16% 0.03% 25.00% + { 49152, 49152, 2}, // 41 1 0.13% 0.03% 20.00% + { 65536, 65536, 2}, // 42 1 0.10% 0.03% 33.33% + { 73728, 73728, 2}, // 43 1 0.09% 0.03% 12.50% + { 81920, 81920, 2}, // 44 1 0.08% 0.03% 11.11% + { 98304, 98304, 2}, // 45 1 0.07% 0.03% 20.00% + {131072, 131072, 2}, // 46 1 0.05% 0.03% 33.33% + {155648, 155648, 2}, // 47 1 0.04% 0.03% 18.75% + {204800, 204800, 2}, // 48 1 0.03% 0.03% 31.58% + {262144, 262144, 2}, // 49 1 0.02% 0.03% 28.00% }; #elif TCMALLOC_PAGE_SHIFT == 15 static_assert(kMaxSize == 262144, "kMaxSize mismatch"); @@ -121,45 +123,45 @@ static constexpr SizeClassInfo List[] = { { 0, 0, 0}, // 0 0 0.00% 0.00% 0.00% { 8, 32768, 32}, // 1 4096 0.19% 1.60% 0.00% { 16, 32768, 32}, // 2 2048 0.19% 1.60% 100.00% - { 32, 32768, 32}, // 3 1024 0.19% 1.60% 100.00% - { 64, 32768, 32}, // 4 512 0.19% 1.60% 100.00% - { 80, 32768, 32}, // 5 409 0.34% 1.60% 25.00% - { 88, 32768, 32}, // 6 372 0.29% 1.60% 10.00% - { 112, 32768, 32}, // 7 292 0.39% 1.60% 27.27% - { 128, 32768, 32}, // 8 256 0.19% 1.60% 14.29% - { 160, 32768, 32}, // 9 204 0.58% 1.60% 25.00% - { 200, 32768, 32}, // 10 163 0.71% 1.60% 25.00% - { 256, 32768, 32}, // 11 128 0.19% 1.60% 28.00% - { 312, 32768, 32}, // 12 105 0.22% 1.60% 21.88% - { 376, 32768, 32}, // 13 87 0.37% 1.60% 20.51% - { 448, 32768, 32}, // 14 73 0.39% 1.60% 19.15% - { 512, 32768, 32}, // 15 64 0.19% 1.60% 14.29% - { 640, 32768, 32}, // 16 51 0.58% 1.60% 25.00% - { 768, 32768, 32}, // 17 42 1.75% 1.60% 20.00% - { 896, 32768, 32}, // 18 36 1.75% 1.60% 16.67% - { 1024, 32768, 32}, // 19 32 0.19% 1.60% 14.29% - { 1152, 32768, 32}, // 20 28 1.75% 1.60% 12.50% - { 1280, 32768, 32}, // 21 25 2.53% 1.60% 11.11% - { 1536, 32768, 32}, // 22 21 1.75% 1.60% 20.00% - { 2048, 32768, 32}, // 23 16 0.19% 1.60% 33.33% - { 2304, 32768, 28}, // 24 14 1.75% 1.60% 12.50% - { 2688, 32768, 24}, // 25 12 1.75% 1.60% 16.67% - { 3200, 32768, 20}, // 26 10 2.53% 1.60% 19.05% - { 4096, 32768, 16}, // 27 8 0.19% 1.60% 28.00% - { 4608, 32768, 14}, // 28 7 1.75% 1.60% 12.50% - { 5376, 32768, 12}, // 29 6 1.75% 1.60% 16.67% - { 6528, 32768, 10}, // 30 5 0.58% 1.60% 21.43% - { 8192, 32768, 8}, // 31 4 0.19% 1.60% 25.49% - { 9344, 65536, 7}, // 32 7 0.29% 1.60% 14.06% - { 13056, 65536, 5}, // 33 5 0.49% 1.60% 39.73% - { 16384, 32768, 4}, // 34 2 0.19% 1.60% 25.49% - { 21760, 65536, 3}, // 35 3 0.49% 1.60% 32.81% - { 28032, 196608, 2}, // 36 7 0.23% 1.60% 28.82% - { 32768, 32768, 2}, // 37 1 0.19% 0.03% 16.89% - { 38144, 163840, 2}, // 38 4 6.91% 3.28% 16.41% - { 49152, 98304, 2}, // 39 2 0.07% 3.16% 28.86% - { 57344, 229376, 2}, // 40 4 0.03% 3.16% 16.67% - { 65536, 65536, 2}, // 41 1 0.10% 0.03% 14.29% + { 24, 32768, 32}, // 3 1365 0.22% 1.60% 50.00% + { 32, 32768, 32}, // 4 1024 0.19% 1.60% 33.33% + { 48, 32768, 32}, // 5 682 0.29% 1.60% 50.00% + { 64, 32768, 32}, // 6 512 0.19% 1.60% 33.33% + { 80, 32768, 32}, // 7 409 0.34% 1.60% 25.00% + { 88, 32768, 32}, // 8 372 0.29% 1.60% 10.00% + { 112, 32768, 32}, // 9 292 0.39% 1.60% 27.27% + { 128, 32768, 32}, // 10 256 0.19% 1.60% 14.29% + { 160, 32768, 32}, // 11 204 0.58% 1.60% 25.00% + { 200, 32768, 32}, // 12 163 0.71% 1.60% 25.00% + { 256, 32768, 32}, // 13 128 0.19% 1.60% 28.00% + { 312, 32768, 32}, // 14 105 0.22% 1.60% 21.88% + { 376, 32768, 32}, // 15 87 0.37% 1.60% 20.51% + { 448, 32768, 32}, // 16 73 0.39% 1.60% 19.15% + { 512, 32768, 32}, // 17 64 0.19% 1.60% 14.29% + { 640, 32768, 32}, // 18 51 0.58% 1.60% 25.00% + { 832, 32768, 32}, // 19 39 1.17% 1.60% 30.00% + { 1024, 32768, 32}, // 20 32 0.19% 1.60% 23.08% + { 1152, 32768, 32}, // 21 28 1.75% 1.60% 12.50% + { 1280, 32768, 32}, // 22 25 2.53% 1.60% 11.11% + { 1536, 32768, 32}, // 23 21 1.75% 1.60% 20.00% + { 2048, 32768, 32}, // 24 16 0.19% 1.60% 33.33% + { 2304, 32768, 28}, // 25 14 1.75% 1.60% 12.50% + { 2688, 32768, 24}, // 26 12 1.75% 1.60% 16.67% + { 3200, 32768, 20}, // 27 10 2.53% 1.60% 19.05% + { 4096, 32768, 16}, // 28 8 0.19% 1.60% 28.00% + { 4608, 32768, 14}, // 29 7 1.75% 1.60% 12.50% + { 5376, 32768, 12}, // 30 6 1.75% 1.60% 16.67% + { 6528, 32768, 10}, // 31 5 0.58% 1.60% 21.43% + { 8192, 32768, 8}, // 32 4 0.19% 1.60% 25.49% + { 9344, 65536, 7}, // 33 7 0.29% 1.60% 14.06% + { 13056, 65536, 5}, // 34 5 0.49% 1.60% 39.73% + { 16384, 32768, 4}, // 35 2 0.19% 1.60% 25.49% + { 21760, 65536, 3}, // 36 3 0.49% 1.60% 32.81% + { 28032, 196608, 2}, // 37 7 0.23% 1.60% 28.82% + { 32768, 32768, 2}, // 38 1 0.19% 0.03% 16.89% + { 40960, 131072, 2}, // 39 3 6.30% 3.28% 25.00% + { 54528, 163840, 2}, // 40 3 0.20% 3.16% 33.12% + { 65536, 65536, 2}, // 41 1 0.10% 0.03% 20.19% { 81920, 163840, 2}, // 42 2 0.04% 4.72% 25.00% {114688, 229376, 2}, // 43 2 0.03% 6.28% 40.00% {131072, 131072, 2}, // 44 1 0.05% 0.03% 14.29% @@ -182,52 +184,52 @@ static constexpr SizeClassInfo List[] = { { 0, 0, 0}, // 0 0 0.00% 0.00% 0.00% { 8, 262144, 32}, // 1 32768 0.02% 12.53% 0.00% { 16, 262144, 32}, // 2 16384 0.02% 12.53% 100.00% - { 32, 262144, 32}, // 3 8192 0.02% 12.53% 100.00% - { 64, 262144, 32}, // 4 4096 0.02% 12.53% 100.00% - { 80, 262144, 32}, // 5 3276 0.05% 12.53% 25.00% - { 96, 262144, 32}, // 6 2730 0.05% 12.53% 20.00% - { 112, 262144, 32}, // 7 2340 0.05% 12.53% 16.67% - { 128, 262144, 32}, // 8 2048 0.02% 12.53% 14.29% - { 152, 262144, 32}, // 9 1724 0.06% 12.53% 18.75% - { 192, 262144, 32}, // 10 1365 0.05% 12.53% 26.32% - { 256, 262144, 32}, // 11 1024 0.02% 12.53% 33.33% - { 304, 262144, 32}, // 12 862 0.06% 12.53% 18.75% - { 384, 262144, 32}, // 13 682 0.12% 12.53% 26.32% - { 448, 262144, 32}, // 14 585 0.05% 12.53% 16.67% - { 512, 262144, 32}, // 15 512 0.02% 12.53% 14.29% - { 576, 262144, 32}, // 16 455 0.05% 12.53% 12.50% - { 640, 262144, 32}, // 17 409 0.17% 12.53% 11.11% - { 768, 262144, 32}, // 18 341 0.12% 12.53% 20.00% - { 832, 262144, 32}, // 19 315 0.05% 12.53% 8.33% - { 1024, 262144, 32}, // 20 256 0.02% 12.53% 23.08% - { 1280, 262144, 32}, // 21 204 0.41% 12.53% 25.00% - { 1664, 262144, 32}, // 22 157 0.37% 12.53% 30.00% - { 2048, 262144, 32}, // 23 128 0.02% 12.53% 23.08% - { 2560, 262144, 25}, // 24 102 0.41% 12.53% 25.00% - { 3200, 262144, 20}, // 25 81 1.15% 12.53% 25.00% - { 4096, 262144, 16}, // 26 64 0.02% 12.53% 28.00% - { 4480, 262144, 14}, // 27 58 0.90% 12.54% 9.38% - { 5120, 262144, 12}, // 28 51 0.41% 12.53% 14.29% - { 6528, 262144, 10}, // 29 40 0.41% 12.53% 27.50% - { 8192, 262144, 8}, // 30 32 0.02% 12.53% 25.49% - { 9600, 262144, 6}, // 31 27 1.15% 12.54% 17.19% - { 11392, 262144, 5}, // 32 23 0.07% 12.53% 18.67% - { 13056, 262144, 5}, // 33 20 0.41% 12.54% 14.61% - { 16384, 262144, 4}, // 34 16 0.02% 12.53% 25.49% - { 21760, 262144, 3}, // 35 12 0.41% 12.54% 32.81% - { 26112, 262144, 2}, // 36 10 0.41% 12.54% 20.00% - { 29056, 262144, 2}, // 37 9 0.27% 12.54% 11.27% - { 32768, 262144, 2}, // 38 8 0.02% 12.53% 12.78% - { 37376, 262144, 2}, // 39 7 0.22% 12.54% 14.06% - { 43648, 262144, 2}, // 40 6 0.12% 12.54% 16.78% - { 52352, 262144, 2}, // 41 5 0.17% 12.54% 19.94% - { 65536, 262144, 2}, // 42 4 0.02% 12.53% 25.18% - { 74880, 524288, 2}, // 43 7 0.04% 12.53% 14.26% - { 87296, 262144, 2}, // 44 3 0.12% 12.54% 16.58% - {104832, 524288, 2}, // 45 5 0.04% 12.54% 20.09% - {131072, 262144, 2}, // 46 2 0.02% 12.53% 25.03% - {149760, 786432, 2}, // 47 5 4.79% 12.88% 14.26% - {174720, 524288, 2}, // 48 3 0.04% 12.54% 16.67% + { 24, 262144, 32}, // 3 10922 0.03% 12.53% 50.00% + { 32, 262144, 32}, // 4 8192 0.02% 12.53% 33.33% + { 48, 262144, 32}, // 5 5461 0.03% 12.53% 50.00% + { 64, 262144, 32}, // 6 4096 0.02% 12.53% 33.33% + { 80, 262144, 32}, // 7 3276 0.05% 12.53% 25.00% + { 96, 262144, 32}, // 8 2730 0.05% 12.53% 20.00% + { 112, 262144, 32}, // 9 2340 0.05% 12.53% 16.67% + { 128, 262144, 32}, // 10 2048 0.02% 12.53% 14.29% + { 152, 262144, 32}, // 11 1724 0.06% 12.53% 18.75% + { 192, 262144, 32}, // 12 1365 0.05% 12.53% 26.32% + { 256, 262144, 32}, // 13 1024 0.02% 12.53% 33.33% + { 304, 262144, 32}, // 14 862 0.06% 12.53% 18.75% + { 384, 262144, 32}, // 15 682 0.12% 12.53% 26.32% + { 448, 262144, 32}, // 16 585 0.05% 12.53% 16.67% + { 512, 262144, 32}, // 17 512 0.02% 12.53% 14.29% + { 640, 262144, 32}, // 18 409 0.17% 12.53% 25.00% + { 768, 262144, 32}, // 19 341 0.12% 12.53% 20.00% + { 832, 262144, 32}, // 20 315 0.05% 12.53% 8.33% + { 1024, 262144, 32}, // 21 256 0.02% 12.53% 23.08% + { 1280, 262144, 32}, // 22 204 0.41% 12.53% 25.00% + { 1664, 262144, 32}, // 23 157 0.37% 12.53% 30.00% + { 2048, 262144, 32}, // 24 128 0.02% 12.53% 23.08% + { 2560, 262144, 25}, // 25 102 0.41% 12.53% 25.00% + { 3200, 262144, 20}, // 26 81 1.15% 12.53% 25.00% + { 4096, 262144, 16}, // 27 64 0.02% 12.53% 28.00% + { 4480, 262144, 14}, // 28 58 0.90% 12.54% 9.38% + { 5120, 262144, 12}, // 29 51 0.41% 12.53% 14.29% + { 6528, 262144, 10}, // 30 40 0.41% 12.53% 27.50% + { 8192, 262144, 8}, // 31 32 0.02% 12.53% 25.49% + { 9600, 262144, 6}, // 32 27 1.15% 12.54% 17.19% + { 11392, 262144, 5}, // 33 23 0.07% 12.53% 18.67% + { 13056, 262144, 5}, // 34 20 0.41% 12.54% 14.61% + { 16384, 262144, 4}, // 35 16 0.02% 12.53% 25.49% + { 21760, 262144, 3}, // 36 12 0.41% 12.54% 32.81% + { 26112, 262144, 2}, // 37 10 0.41% 12.54% 20.00% + { 29056, 262144, 2}, // 38 9 0.27% 12.54% 11.27% + { 32768, 262144, 2}, // 39 8 0.02% 12.53% 12.78% + { 37376, 262144, 2}, // 40 7 0.22% 12.54% 14.06% + { 43648, 262144, 2}, // 41 6 0.12% 12.54% 16.78% + { 52352, 262144, 2}, // 42 5 0.17% 12.54% 19.94% + { 65536, 262144, 2}, // 43 4 0.02% 12.53% 25.18% + { 74880, 524288, 2}, // 44 7 0.04% 12.53% 14.26% + { 87296, 262144, 2}, // 45 3 0.12% 12.54% 16.58% + {104832, 524288, 2}, // 46 5 0.04% 12.54% 20.09% + {131072, 262144, 2}, // 47 2 0.02% 12.53% 25.03% + {174720, 524288, 2}, // 48 3 0.04% 12.54% 33.30% {209664, 1048576, 2}, // 49 5 0.03% 12.54% 20.00% {262144, 262144, 2}, // 50 1 0.02% 0.03% 25.03% }; @@ -246,14 +248,14 @@ static constexpr SizeClassInfo List[] = { { 0, 0, 0}, // 0 0 0.00% 0.00% 0.00% { 8, 4096, 32}, // 1 512 1.54% 0.23% 0.00% { 16, 4096, 32}, // 2 256 1.54% 0.23% 100.00% - { 32, 4096, 32}, // 3 128 1.54% 0.23% 100.00% - { 64, 4096, 32}, // 4 64 1.54% 0.23% 100.00% - { 72, 4096, 32}, // 5 56 3.08% 0.23% 12.50% - { 80, 4096, 32}, // 6 51 1.92% 0.23% 11.11% - { 96, 4096, 32}, // 7 42 3.08% 0.23% 20.00% - { 128, 4096, 32}, // 8 32 1.54% 0.23% 33.33% - { 144, 4096, 32}, // 9 28 3.08% 0.23% 12.50% - { 160, 4096, 32}, // 10 25 3.85% 0.23% 11.11% + { 24, 4096, 32}, // 3 170 1.92% 0.23% 50.00% + { 32, 4096, 32}, // 4 128 1.54% 0.23% 33.33% + { 48, 4096, 32}, // 5 85 1.92% 0.23% 50.00% + { 64, 4096, 32}, // 6 64 1.54% 0.23% 33.33% + { 80, 4096, 32}, // 7 51 1.92% 0.23% 25.00% + { 96, 4096, 32}, // 8 42 3.08% 0.23% 20.00% + { 128, 4096, 32}, // 9 32 1.54% 0.23% 33.33% + { 160, 4096, 32}, // 10 25 3.85% 0.23% 25.00% { 224, 4096, 32}, // 11 18 3.08% 0.23% 40.00% { 256, 4096, 32}, // 12 16 1.54% 0.23% 14.29% { 288, 4096, 32}, // 13 14 3.08% 0.23% 12.50% @@ -290,50 +292,51 @@ static constexpr SizeClassInfo List[] = { { 8, 8192, 32}, // 1 1024 0.78% 0.42% 0.00% { 16, 8192, 32}, // 2 512 0.78% 0.42% 100.00% { 32, 8192, 32}, // 3 256 0.78% 0.42% 100.00% - { 64, 8192, 32}, // 4 128 0.78% 0.42% 100.00% - { 80, 8192, 32}, // 5 102 1.16% 0.42% 25.00% - { 96, 8192, 32}, // 6 85 1.16% 0.42% 20.00% - { 112, 8192, 32}, // 7 73 0.97% 0.42% 16.67% - { 128, 8192, 32}, // 8 64 0.78% 0.42% 14.29% - { 160, 8192, 32}, // 9 51 1.16% 0.42% 25.00% - { 176, 8192, 32}, // 10 46 1.94% 0.42% 10.00% - { 208, 8192, 32}, // 11 39 1.74% 0.42% 18.18% - { 256, 8192, 32}, // 12 32 0.78% 0.42% 23.08% - { 304, 8192, 32}, // 13 26 4.26% 0.42% 18.75% - { 368, 8192, 32}, // 14 22 1.94% 0.42% 21.05% - { 448, 8192, 32}, // 15 18 2.33% 0.42% 21.74% - { 512, 8192, 32}, // 16 16 0.78% 0.42% 14.29% - { 576, 8192, 32}, // 17 14 2.33% 0.42% 12.50% - { 704, 8192, 32}, // 18 11 6.20% 0.43% 22.22% - { 896, 8192, 32}, // 19 9 2.33% 0.42% 27.27% - { 1024, 8192, 32}, // 20 8 0.78% 0.42% 14.29% - { 1152, 16384, 32}, // 21 14 1.95% 0.42% 12.50% - { 1408, 16384, 32}, // 22 11 5.84% 0.43% 22.22% - { 1792, 16384, 32}, // 23 9 1.95% 0.43% 27.27% - { 2048, 8192, 32}, // 24 4 0.78% 0.42% 14.29% - { 2304, 16384, 28}, // 25 7 1.95% 0.43% 12.50% - { 2688, 16384, 24}, // 26 6 1.95% 0.43% 16.67% - { 3456, 24576, 18}, // 27 7 1.82% 0.43% 28.57% - { 4096, 8192, 16}, // 28 2 0.78% 0.43% 18.52% - { 4736, 24576, 13}, // 29 5 3.90% 0.43% 15.62% - { 6144, 24576, 10}, // 30 4 0.26% 0.42% 29.73% - { 8192, 8192, 8}, // 31 1 0.78% 0.03% 33.33% - { 9472, 40960, 6}, // 32 4 7.64% 0.85% 15.62% - { 12288, 24576, 5}, // 33 2 0.26% 0.82% 29.73% - { 16384, 16384, 4}, // 34 1 0.39% 0.03% 33.33% - { 20480, 40960, 3}, // 35 2 0.16% 1.21% 25.00% - { 28672, 57344, 2}, // 36 2 0.11% 1.60% 40.00% - { 32768, 32768, 2}, // 37 1 0.19% 0.03% 14.29% - { 40960, 40960, 2}, // 38 1 0.16% 0.03% 25.00% - { 49152, 49152, 2}, // 39 1 0.13% 0.03% 20.00% - { 65536, 65536, 2}, // 40 1 0.10% 0.03% 33.33% - { 73728, 73728, 2}, // 41 1 0.09% 0.03% 12.50% - { 81920, 81920, 2}, // 42 1 0.08% 0.03% 11.11% - { 98304, 98304, 2}, // 43 1 0.07% 0.03% 20.00% - {131072, 131072, 2}, // 44 1 0.05% 0.03% 33.33% - {155648, 155648, 2}, // 45 1 0.04% 0.03% 18.75% - {204800, 204800, 2}, // 46 1 0.03% 0.03% 31.58% - {262144, 262144, 2}, // 47 1 0.02% 0.03% 28.00% + { 48, 8192, 32}, // 4 170 1.16% 0.42% 50.00% + { 64, 8192, 32}, // 5 128 0.78% 0.42% 33.33% + { 80, 8192, 32}, // 6 102 1.16% 0.42% 25.00% + { 96, 8192, 32}, // 7 85 1.16% 0.42% 20.00% + { 112, 8192, 32}, // 8 73 0.97% 0.42% 16.67% + { 128, 8192, 32}, // 9 64 0.78% 0.42% 14.29% + { 160, 8192, 32}, // 10 51 1.16% 0.42% 25.00% + { 176, 8192, 32}, // 11 46 1.94% 0.42% 10.00% + { 208, 8192, 32}, // 12 39 1.74% 0.42% 18.18% + { 256, 8192, 32}, // 13 32 0.78% 0.42% 23.08% + { 304, 8192, 32}, // 14 26 4.26% 0.42% 18.75% + { 368, 8192, 32}, // 15 22 1.94% 0.42% 21.05% + { 448, 8192, 32}, // 16 18 2.33% 0.42% 21.74% + { 512, 8192, 32}, // 17 16 0.78% 0.42% 14.29% + { 576, 8192, 32}, // 18 14 2.33% 0.42% 12.50% + { 704, 8192, 32}, // 19 11 6.20% 0.43% 22.22% + { 896, 8192, 32}, // 20 9 2.33% 0.42% 27.27% + { 1024, 8192, 32}, // 21 8 0.78% 0.42% 14.29% + { 1152, 16384, 32}, // 22 14 1.95% 0.42% 12.50% + { 1408, 16384, 32}, // 23 11 5.84% 0.43% 22.22% + { 1792, 16384, 32}, // 24 9 1.95% 0.43% 27.27% + { 2048, 8192, 32}, // 25 4 0.78% 0.42% 14.29% + { 2304, 16384, 28}, // 26 7 1.95% 0.43% 12.50% + { 2688, 16384, 24}, // 27 6 1.95% 0.43% 16.67% + { 3456, 24576, 18}, // 28 7 1.82% 0.43% 28.57% + { 4096, 8192, 16}, // 29 2 0.78% 0.43% 18.52% + { 4736, 24576, 13}, // 30 5 3.90% 0.43% 15.62% + { 6144, 24576, 10}, // 31 4 0.26% 0.42% 29.73% + { 8192, 8192, 8}, // 32 1 0.78% 0.03% 33.33% + { 9472, 40960, 6}, // 33 4 7.64% 0.85% 15.62% + { 12288, 24576, 5}, // 34 2 0.26% 0.82% 29.73% + { 16384, 16384, 4}, // 35 1 0.39% 0.03% 33.33% + { 20480, 40960, 3}, // 36 2 0.16% 1.21% 25.00% + { 28672, 57344, 2}, // 37 2 0.11% 1.60% 40.00% + { 32768, 32768, 2}, // 38 1 0.19% 0.03% 14.29% + { 40960, 40960, 2}, // 39 1 0.16% 0.03% 25.00% + { 49152, 49152, 2}, // 40 1 0.13% 0.03% 20.00% + { 65536, 65536, 2}, // 41 1 0.10% 0.03% 33.33% + { 73728, 73728, 2}, // 42 1 0.09% 0.03% 12.50% + { 81920, 81920, 2}, // 43 1 0.08% 0.03% 11.11% + { 98304, 98304, 2}, // 44 1 0.07% 0.03% 20.00% + {131072, 131072, 2}, // 45 1 0.05% 0.03% 33.33% + {155648, 155648, 2}, // 46 1 0.04% 0.03% 18.75% + {204800, 204800, 2}, // 47 1 0.03% 0.03% 31.58% + {262144, 262144, 2}, // 48 1 0.02% 0.03% 28.00% }; #elif TCMALLOC_PAGE_SHIFT == 15 static_assert(kMaxSize == 262144, "kMaxSize mismatch"); @@ -351,22 +354,22 @@ static constexpr SizeClassInfo List[] = { { 8, 32768, 32}, // 1 4096 0.19% 1.60% 0.00% { 16, 32768, 32}, // 2 2048 0.19% 1.60% 100.00% { 32, 32768, 32}, // 3 1024 0.19% 1.60% 100.00% - { 64, 32768, 32}, // 4 512 0.19% 1.60% 100.00% - { 80, 32768, 32}, // 5 409 0.34% 1.60% 25.00% - { 96, 32768, 32}, // 6 341 0.29% 1.60% 20.00% - { 112, 32768, 32}, // 7 292 0.39% 1.60% 16.67% - { 128, 32768, 32}, // 8 256 0.19% 1.60% 14.29% - { 160, 32768, 32}, // 9 204 0.58% 1.60% 25.00% - { 192, 32768, 32}, // 10 170 0.58% 1.60% 20.00% - { 256, 32768, 32}, // 11 128 0.19% 1.60% 33.33% - { 320, 32768, 32}, // 12 102 0.58% 1.60% 25.00% - { 384, 32768, 32}, // 13 85 0.58% 1.60% 20.00% - { 448, 32768, 32}, // 14 73 0.39% 1.60% 16.67% - { 512, 32768, 32}, // 15 64 0.19% 1.60% 14.29% - { 640, 32768, 32}, // 16 51 0.58% 1.60% 25.00% - { 768, 32768, 32}, // 17 42 1.75% 1.60% 20.00% - { 896, 32768, 32}, // 18 36 1.75% 1.60% 16.67% - { 1024, 32768, 32}, // 19 32 0.19% 1.60% 14.29% + { 48, 32768, 32}, // 4 682 0.29% 1.60% 50.00% + { 64, 32768, 32}, // 5 512 0.19% 1.60% 33.33% + { 80, 32768, 32}, // 6 409 0.34% 1.60% 25.00% + { 96, 32768, 32}, // 7 341 0.29% 1.60% 20.00% + { 112, 32768, 32}, // 8 292 0.39% 1.60% 16.67% + { 128, 32768, 32}, // 9 256 0.19% 1.60% 14.29% + { 160, 32768, 32}, // 10 204 0.58% 1.60% 25.00% + { 192, 32768, 32}, // 11 170 0.58% 1.60% 20.00% + { 256, 32768, 32}, // 12 128 0.19% 1.60% 33.33% + { 320, 32768, 32}, // 13 102 0.58% 1.60% 25.00% + { 384, 32768, 32}, // 14 85 0.58% 1.60% 20.00% + { 448, 32768, 32}, // 15 73 0.39% 1.60% 16.67% + { 512, 32768, 32}, // 16 64 0.19% 1.60% 14.29% + { 640, 32768, 32}, // 17 51 0.58% 1.60% 25.00% + { 832, 32768, 32}, // 18 39 1.17% 1.60% 30.00% + { 1024, 32768, 32}, // 19 32 0.19% 1.60% 23.08% { 1152, 32768, 32}, // 20 28 1.75% 1.60% 12.50% { 1280, 32768, 32}, // 21 25 2.53% 1.60% 11.11% { 1536, 32768, 32}, // 22 21 1.75% 1.60% 20.00% @@ -412,20 +415,20 @@ static constexpr SizeClassInfo List[] = { { 8, 262144, 32}, // 1 32768 0.02% 12.53% 0.00% { 16, 262144, 32}, // 2 16384 0.02% 12.53% 100.00% { 32, 262144, 32}, // 3 8192 0.02% 12.53% 100.00% - { 64, 262144, 32}, // 4 4096 0.02% 12.53% 100.00% - { 80, 262144, 32}, // 5 3276 0.05% 12.53% 25.00% - { 96, 262144, 32}, // 6 2730 0.05% 12.53% 20.00% - { 112, 262144, 32}, // 7 2340 0.05% 12.53% 16.67% - { 128, 262144, 32}, // 8 2048 0.02% 12.53% 14.29% - { 160, 262144, 32}, // 9 1638 0.05% 12.53% 25.00% - { 192, 262144, 32}, // 10 1365 0.05% 12.53% 20.00% - { 256, 262144, 32}, // 11 1024 0.02% 12.53% 33.33% - { 304, 262144, 32}, // 12 862 0.06% 12.53% 18.75% - { 384, 262144, 32}, // 13 682 0.12% 12.53% 26.32% - { 448, 262144, 32}, // 14 585 0.05% 12.53% 16.67% - { 512, 262144, 32}, // 15 512 0.02% 12.53% 14.29% - { 576, 262144, 32}, // 16 455 0.05% 12.53% 12.50% - { 640, 262144, 32}, // 17 409 0.17% 12.53% 11.11% + { 48, 262144, 32}, // 4 5461 0.03% 12.53% 50.00% + { 64, 262144, 32}, // 5 4096 0.02% 12.53% 33.33% + { 80, 262144, 32}, // 6 3276 0.05% 12.53% 25.00% + { 96, 262144, 32}, // 7 2730 0.05% 12.53% 20.00% + { 112, 262144, 32}, // 8 2340 0.05% 12.53% 16.67% + { 128, 262144, 32}, // 9 2048 0.02% 12.53% 14.29% + { 160, 262144, 32}, // 10 1638 0.05% 12.53% 25.00% + { 192, 262144, 32}, // 11 1365 0.05% 12.53% 20.00% + { 256, 262144, 32}, // 12 1024 0.02% 12.53% 33.33% + { 304, 262144, 32}, // 13 862 0.06% 12.53% 18.75% + { 384, 262144, 32}, // 14 682 0.12% 12.53% 26.32% + { 448, 262144, 32}, // 15 585 0.05% 12.53% 16.67% + { 512, 262144, 32}, // 16 512 0.02% 12.53% 14.29% + { 640, 262144, 32}, // 17 409 0.17% 12.53% 25.00% { 768, 262144, 32}, // 18 341 0.12% 12.53% 20.00% { 832, 262144, 32}, // 19 315 0.05% 12.53% 8.33% { 1024, 262144, 32}, // 20 256 0.02% 12.53% 23.08% @@ -476,25 +479,25 @@ static constexpr SizeClassInfo List[] = { { 8, 4096, 32}, // 1 512 1.54% 0.23% 0.00% { 16, 4096, 32}, // 2 256 1.54% 0.23% 100.00% { 32, 4096, 32}, // 3 128 1.54% 0.23% 100.00% - { 64, 4096, 32}, // 4 64 1.54% 0.23% 100.00% - { 80, 4096, 32}, // 5 51 1.92% 0.23% 25.00% - { 96, 4096, 32}, // 6 42 3.08% 0.23% 20.00% - { 128, 4096, 32}, // 7 32 1.54% 0.23% 33.33% - { 144, 4096, 32}, // 8 28 3.08% 0.23% 12.50% - { 160, 4096, 32}, // 9 25 3.85% 0.23% 11.11% - { 224, 4096, 32}, // 10 18 3.08% 0.23% 40.00% - { 256, 4096, 32}, // 11 16 1.54% 0.23% 14.29% - { 288, 4096, 32}, // 12 14 3.08% 0.23% 12.50% - { 368, 4096, 32}, // 13 11 2.69% 0.23% 27.78% - { 512, 4096, 32}, // 14 8 1.54% 0.23% 39.13% - { 576, 8192, 32}, // 15 14 2.33% 0.23% 12.50% - { 768, 8192, 32}, // 16 10 6.98% 0.23% 33.33% - { 1024, 8192, 32}, // 17 8 0.78% 0.23% 33.33% - { 1536, 12288, 32}, // 18 8 0.52% 0.23% 50.00% - { 2048, 16384, 32}, // 19 8 0.39% 0.23% 33.33% - { 2688, 16384, 24}, // 20 6 1.95% 0.23% 31.25% - { 3328, 20480, 19}, // 21 6 2.80% 0.23% 23.81% - { 4096, 16384, 16}, // 22 4 0.39% 0.23% 23.08% + { 48, 4096, 32}, // 4 85 1.92% 0.23% 50.00% + { 64, 4096, 32}, // 5 64 1.54% 0.23% 33.33% + { 80, 4096, 32}, // 6 51 1.92% 0.23% 25.00% + { 96, 4096, 32}, // 7 42 3.08% 0.23% 20.00% + { 128, 4096, 32}, // 8 32 1.54% 0.23% 33.33% + { 144, 4096, 32}, // 9 28 3.08% 0.23% 12.50% + { 160, 4096, 32}, // 10 25 3.85% 0.23% 11.11% + { 224, 4096, 32}, // 11 18 3.08% 0.23% 40.00% + { 256, 4096, 32}, // 12 16 1.54% 0.23% 14.29% + { 288, 4096, 32}, // 13 14 3.08% 0.23% 12.50% + { 368, 4096, 32}, // 14 11 2.69% 0.23% 27.78% + { 512, 4096, 32}, // 15 8 1.54% 0.23% 39.13% + { 576, 8192, 32}, // 16 14 2.33% 0.23% 12.50% + { 768, 8192, 32}, // 17 10 6.98% 0.23% 33.33% + { 1024, 8192, 32}, // 18 8 0.78% 0.23% 33.33% + { 1536, 12288, 32}, // 19 8 0.52% 0.23% 50.00% + { 2048, 16384, 32}, // 20 8 0.39% 0.23% 33.33% + { 2688, 16384, 24}, // 21 6 1.95% 0.23% 31.25% + { 4096, 16384, 16}, // 22 4 0.39% 0.23% 52.38% { 4736, 20480, 13}, // 23 4 7.79% 0.44% 15.62% { 6144, 12288, 10}, // 24 2 0.52% 0.43% 29.73% { 8192, 16384, 8}, // 25 2 0.39% 0.43% 33.33% diff --git a/tcmalloc/size_classes_test.cc b/tcmalloc/size_classes_test.cc index 07454085e..614b65988 100644 --- a/tcmalloc/size_classes_test.cc +++ b/tcmalloc/size_classes_test.cc @@ -182,7 +182,6 @@ TEST_F(RunTimeSizeClassesTest, WastedSpan) { // (alignment) at the end of the span. switch (tc_globals.size_class_configuration()) { case SizeClassConfiguration::kLegacy: - case SizeClassConfiguration::kReuse: case SizeClassConfiguration::kReuseRelaxedBelow64: // This test fails for other classes (was passing with a different span // size allocation algorithm used between cl/130150125 and cl/139955211). diff --git a/tcmalloc/sizemap.cc b/tcmalloc/sizemap.cc index 4f42c552b..800a0bbdf 100644 --- a/tcmalloc/sizemap.cc +++ b/tcmalloc/sizemap.cc @@ -46,9 +46,6 @@ const SizeClasses& SizeMap::CurrentClasses() { case SizeClassConfiguration::kPow2Only: return kExperimentalPow2SizeClasses; case SizeClassConfiguration::kReuseRelaxedBelow64: - return kReuseRelaxedBelow64SizeClasses; - case SizeClassConfiguration::kReuse: - // TODO(b/512895228): remove this opt out once we are done experimenting. return kSizeClasses; case SizeClassConfiguration::kLegacy: // TODO(b/242710633): remove this opt out. diff --git a/tcmalloc/sizemap.h b/tcmalloc/sizemap.h index e01a70487..f6f127be0 100644 --- a/tcmalloc/sizemap.h +++ b/tcmalloc/sizemap.h @@ -44,12 +44,10 @@ extern const SizeClasses kSizeClasses; // Experimental size classes: extern const SizeClasses kExperimentalPow2SizeClasses; extern const SizeClasses kLegacySizeClasses; -extern const SizeClasses kReuseRelaxedBelow64SizeClasses; enum class SizeClassConfiguration { kPow2Only = 2, kLegacy = 4, - kReuse = 6, kReuseRelaxedBelow64 = 8, }; diff --git a/tcmalloc/sizemap_test.cc b/tcmalloc/sizemap_test.cc index 518787121..f653d34dc 100644 --- a/tcmalloc/sizemap_test.cc +++ b/tcmalloc/sizemap_test.cc @@ -86,7 +86,6 @@ TEST(ColdSizeClassTest, ColdFeatureActivation) { const SizeClasses* const kAllSizeClassesConfigs[] = { &kSizeClasses, &kLegacySizeClasses, - &kReuseRelaxedBelow64SizeClasses, &kExperimentalPow2SizeClasses, }; @@ -266,10 +265,10 @@ TEST(SizeMapTest, HeapPartitioningSizeZero) { } TEST(SizeMapTest, SpecificClassRanges) { - // Verify kReuseRelaxedBelow64SizeClasses (with 24/48) + // Verify kSizeClasses (with 24/48) { SizeMap size_map; - ASSERT_TRUE(size_map.Init(kReuseRelaxedBelow64SizeClasses.classes)); + ASSERT_TRUE(size_map.Init(kSizeClasses.classes)); EXPECT_THAT(size_map.class_to_size_range(1), Pair(1, 8)); EXPECT_THAT(size_map.class_to_size_range(2), Pair(9, 16)); #if defined(__cpp_aligned_new) && __STDCPP_DEFAULT_NEW_ALIGNMENT__ <= 8 @@ -284,15 +283,6 @@ TEST(SizeMapTest, SpecificClassRanges) { #endif } - // Verify kSizeClasses (default, power of two below 64) - { - SizeMap size_map; - ASSERT_TRUE(size_map.Init(kSizeClasses.classes)); - EXPECT_THAT(size_map.class_to_size_range(1), Pair(1, 8)); - EXPECT_THAT(size_map.class_to_size_range(2), Pair(9, 16)); - EXPECT_THAT(size_map.class_to_size_range(3), Pair(17, 32)); - EXPECT_THAT(size_map.class_to_size_range(4), Pair(33, 64)); - } } } // namespace tcmalloc::tcmalloc_internal diff --git a/tcmalloc/static_vars.cc b/tcmalloc/static_vars.cc index 36545b2b4..e90b99400 100644 --- a/tcmalloc/static_vars.cc +++ b/tcmalloc/static_vars.cc @@ -171,15 +171,10 @@ SizeClassConfiguration Static::size_class_configuration() { const char* e_reuse = thread_safe_getenv("TCMALLOC_REUSE_SIZE_CLASSES"); const char* e_legacy = thread_safe_getenv("TCMALLOC_LEGACY_SIZE_CLASSES"); - if (IsExperimentActive(Experiment::TCMALLOC_REUSE_SIZE_CLASSES_ABLATION)) { - return SizeClassConfiguration::kReuse; - } if (e_reuse != nullptr) { if (!strcmp(e_reuse, "reuserelaxedbelow64")) { return SizeClassConfiguration::kReuseRelaxedBelow64; - } else if (!strcmp(e_reuse, "reuse")) { - return SizeClassConfiguration::kReuse; } else if (!strcmp(e_reuse, "0")) { // "0" is a valid value that falls back to the default. } else { diff --git a/tcmalloc/tcmalloc_variants.cmake b/tcmalloc/tcmalloc_variants.cmake index da45788fe..2538015b8 100644 --- a/tcmalloc/tcmalloc_variants.cmake +++ b/tcmalloc/tcmalloc_variants.cmake @@ -203,22 +203,6 @@ function(tcmalloc_cc_test_variants) DEPS ${TCMALLOC_DEPS} $ ) set_tests_properties(${TCMALLOC_NAME}_legacy_size_classes PROPERTIES ENVIRONMENT "TEST_TMPDIR=${CMAKE_CURRENT_BINARY_DIR};TEST_SRCDIR=${CMAKE_SOURCE_DIR}") - tcmalloc_cc_test(NAME ${TCMALLOC_NAME}_reuse_size_classes - SRCS ${TCMALLOC_SRCS} - HDRS ${TCMALLOC_HDRS} - COPTS ${TCMALLOC_COPTS} - LINKOPTS ${TCMALLOC_LINKOPTS} - DEPS ${TCMALLOC_DEPS} $ - ) - set_tests_properties(${TCMALLOC_NAME}_reuse_size_classes PROPERTIES ENVIRONMENT "TCMALLOC_REUSE_SIZE_CLASSES=reuse;TEST_TMPDIR=${CMAKE_CURRENT_BINARY_DIR};TEST_SRCDIR=${CMAKE_SOURCE_DIR}") - tcmalloc_cc_test(NAME ${TCMALLOC_NAME}_reuserelaxedbelow64_size_classes - SRCS ${TCMALLOC_SRCS} - HDRS ${TCMALLOC_HDRS} - COPTS ${TCMALLOC_COPTS} - LINKOPTS ${TCMALLOC_LINKOPTS} - DEPS ${TCMALLOC_DEPS} $ - ) - set_tests_properties(${TCMALLOC_NAME}_reuserelaxedbelow64_size_classes PROPERTIES ENVIRONMENT "TCMALLOC_REUSE_SIZE_CLASSES=reuserelaxedbelow64;TEST_TMPDIR=${CMAKE_CURRENT_BINARY_DIR};TEST_SRCDIR=${CMAKE_SOURCE_DIR}") tcmalloc_cc_test(NAME ${TCMALLOC_NAME}_hpaa SRCS ${TCMALLOC_SRCS} HDRS ${TCMALLOC_HDRS} diff --git a/tcmalloc/variants.bzl b/tcmalloc/variants.bzl index a46d71125..998976c4f 100644 --- a/tcmalloc/variants.bzl +++ b/tcmalloc/variants.bzl @@ -183,22 +183,6 @@ test_variants = [ ], "copts": [], }, - { - "name": "reuse_size_classes", - "malloc": "//tcmalloc", - "deps": [ - "//tcmalloc:common_8k_pages", - ], - "env": {"TCMALLOC_REUSE_SIZE_CLASSES": "reuse"}, - }, - { - "name": "reuserelaxedbelow64_size_classes", - "malloc": "//tcmalloc", - "deps": [ - "//tcmalloc:common_8k_pages", - ], - "env": {"TCMALLOC_REUSE_SIZE_CLASSES": "reuserelaxedbelow64"}, - }, { "name": "hpaa", "malloc": "//tcmalloc",