Skip to content

Commit 6792dec

Browse files
nilayvaishcopybara-github
authored andcommitted
Configure experiment for TCMALLOC_COARSE_LFR_TRACKERS
PiperOrigin-RevId: 769162986 Change-Id: Iebc8743324797b4c03219ae26d2eaf44f0d00eb2
1 parent 13bb12f commit 6792dec

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

tcmalloc/experiment_config.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ namespace tcmalloc {
2323
enum class Experiment : int {
2424
// clang-format off
2525
// go/keep-sorted start
26+
TCMALLOC_COARSE_LFR_TRACKERS, // TODO(b/368054442): Complete experiment.
2627
TCMALLOC_USERMODE_HUGEPAGE_COLLAPSE, // TODO(b/287498389): Complete experiment.
2728
TEST_ONLY_L3_AWARE, // TODO(b/239977380): Complete experiment.
2829
TEST_ONLY_TCMALLOC_COARSE_LFR_TRACKERS, // TODO(b/368054442): Complete experiment.
@@ -42,6 +43,7 @@ struct ExperimentConfig {
4243
// clang-format off
4344
inline constexpr ExperimentConfig experiments[] = {
4445
// go/keep-sorted start
46+
{Experiment::TCMALLOC_COARSE_LFR_TRACKERS, "TCMALLOC_COARSE_LFR_TRACKERS"},
4547
{Experiment::TCMALLOC_USERMODE_HUGEPAGE_COLLAPSE, "TCMALLOC_USERMODE_HUGEPAGE_COLLAPSE"},
4648
{Experiment::TEST_ONLY_L3_AWARE, "TEST_ONLY_L3_AWARE"},
4749
{Experiment::TEST_ONLY_TCMALLOC_COARSE_LFR_TRACKERS, "TEST_ONLY_TCMALLOC_COARSE_LFR_TRACKERS"},

tcmalloc/parameters.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,10 @@ bool Parameters::sparse_trackers_coarse_longest_free_range() {
293293
ABSL_CONST_INIT static absl::once_flag flag;
294294
ABSL_CONST_INIT static std::atomic<bool> v{false};
295295
absl::base_internal::LowLevelCallOnce(&flag, [&]() {
296-
v.store(
297-
IsExperimentActive(Experiment::TEST_ONLY_TCMALLOC_COARSE_LFR_TRACKERS),
298-
std::memory_order_relaxed);
296+
v.store(IsExperimentActive(
297+
Experiment::TEST_ONLY_TCMALLOC_COARSE_LFR_TRACKERS) ||
298+
IsExperimentActive(Experiment::TCMALLOC_COARSE_LFR_TRACKERS),
299+
std::memory_order_relaxed);
299300
});
300301
return v;
301302
}

tcmalloc/variants.bzl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,20 @@ test_variants = [
142142
"tags": ["noubsan"],
143143
},
144144
{
145-
"name": "sparse_trackers_coarse_longest_free_range",
145+
"name": "sparse_trackers_coarse_longest_free_range_test",
146146
"malloc": "//tcmalloc",
147147
"deps": [
148148
"//tcmalloc:common_8k_pages",
149149
],
150-
"env": {"TEST_ONLY_TCMALLOC_COARSE_LFR_TRACKERS": "1"},
150+
"env": {"BORG_EXPERIMENTS": "TEST_ONLY_TCMALLOC_COARSE_LFR_TRACKERS"},
151+
},
152+
{
153+
"name": "sparse_trackers_coarse_longest_free_range_exp",
154+
"malloc": "//tcmalloc",
155+
"deps": [
156+
"//tcmalloc:common_8k_pages",
157+
],
158+
"env": {"BORG_EXPERIMENTS": "TCMALLOC_COARSE_LFR_TRACKERS"},
151159
},
152160
{
153161
"name": "256k_pages_pow2_sharded_transfer_cache",

0 commit comments

Comments
 (0)