Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion tcmalloc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion tcmalloc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 1 addition & 3 deletions tcmalloc/cpu_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 0 additions & 2 deletions tcmalloc/global_stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand Down
522 changes: 0 additions & 522 deletions tcmalloc/reuse_relaxed_below_64_size_classes.cc

This file was deleted.

465 changes: 234 additions & 231 deletions tcmalloc/size_classes.cc

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion tcmalloc/size_classes_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
3 changes: 0 additions & 3 deletions tcmalloc/sizemap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions tcmalloc/sizemap.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand Down
14 changes: 2 additions & 12 deletions tcmalloc/sizemap_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ TEST(ColdSizeClassTest, ColdFeatureActivation) {
const SizeClasses* const kAllSizeClassesConfigs[] = {
&kSizeClasses,
&kLegacySizeClasses,
&kReuseRelaxedBelow64SizeClasses,
&kExperimentalPow2SizeClasses,
};

Expand Down Expand Up @@ -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
Expand All @@ -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
5 changes: 0 additions & 5 deletions tcmalloc/static_vars.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
16 changes: 0 additions & 16 deletions tcmalloc/tcmalloc_variants.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -203,22 +203,6 @@ function(tcmalloc_cc_test_variants)
DEPS ${TCMALLOC_DEPS} $<LINK_LIBRARY:WHOLE_ARCHIVE,tcmalloc::tcmalloc,tcmalloc::common_8k_pages,tcmalloc::want_legacy_size_classes>
)
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} $<LINK_LIBRARY:WHOLE_ARCHIVE,tcmalloc::tcmalloc,tcmalloc::common_8k_pages>
)
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} $<LINK_LIBRARY:WHOLE_ARCHIVE,tcmalloc::tcmalloc,tcmalloc::common_8k_pages>
)
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}
Expand Down
16 changes: 0 additions & 16 deletions tcmalloc/variants.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading