Skip to content

Commit

Permalink
Switch to using ring-based TransferCache by default.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 400713544
Change-Id: Icc4e69fe51ab2257d0dc503d05cd16ff53066f2a
  • Loading branch information
Philipp Brüschweiler authored and copybara-github committed Oct 4, 2021
1 parent b2435cb commit 45c59cc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tcmalloc/testing/get_stats_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ TEST_F(GetStatsTest, Pbtxt) {
EXPECT_THAT(buf, HasSubstr("percpu_slab_residence: 0"));
}
EXPECT_THAT(buf, ContainsRegex("(cpus_allowed: [1-9][0-9]*)"));
EXPECT_THAT(buf, HasSubstr("transfer_cache_implementation: LEGACY"));
EXPECT_THAT(buf, HasSubstr("transfer_cache_implementation: RING"));

EXPECT_THAT(buf, HasSubstr("desired_usage_limit_bytes: -1"));
EXPECT_THAT(buf, HasSubstr("limit_hits: 0"));
Expand Down
4 changes: 2 additions & 2 deletions tcmalloc/transfer_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ TransferCacheImplementation TransferCacheManager::ChooseImplementation() {
Crash(kCrash, __FILE__, __LINE__, "bad env var", e);
}

// Otherwise, default to legacy.
return TransferCacheImplementation::Legacy;
// Otherwise, default to ring.
return TransferCacheImplementation::Ring;
}

int TransferCacheManager::DetermineSizeClassToEvict() {
Expand Down
6 changes: 6 additions & 0 deletions tcmalloc/variants.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ variants = [
"deps": ["//tcmalloc:common"],
"env": {"BORG_EXPERIMENTS": "TEST_ONLY_TCMALLOC_RING_BUFFER_TRANSFER_CACHE"},
},
{
"name": "legacy_transfer_cache",
"malloc": "//tcmalloc",
"deps": ["//tcmalloc:common"],
"env": {"TCMALLOC_INTERNAL_TRANSFERCACHE_CONTROL": "0"},
},
{
"name": "256k_pages_pow2_with_per_ccx",
"malloc": "//tcmalloc:tcmalloc_256k_pages",
Expand Down

0 comments on commit 45c59cc

Please sign in to comment.