Skip to content

Commit ffa4be7

Browse files
authored
stable-25-3-1: Fix broken TCMalloc options. (#26365)
2 parents 6306922 + bdadd8b commit ffa4be7

File tree

8 files changed

+40
-9
lines changed

8 files changed

+40
-9
lines changed

contrib/libs/tcmalloc/.yandex_meta/build.ym

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ SRCS(
3535
INCLUDE(common.inc)
3636

3737
CFLAGS(
38-
-DTCMALLOC_256K_PAGES
38+
-DTCMALLOC_INTERNAL_256K_PAGES
3939
)
4040
{% endblock %}
4141

contrib/libs/tcmalloc/no_percpu_cache/ya.make

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ SRCS(
2424
)
2525

2626
CFLAGS(
27-
-DTCMALLOC_256K_PAGES
27+
-DTCMALLOC_INTERNAL_256K_PAGES
2828
-DTCMALLOC_DEPRECATED_PERTHREAD
2929
)
3030

contrib/libs/tcmalloc/numa_256k/ya.make

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ GLOBAL_SRCS(
2020
)
2121

2222
CFLAGS(
23-
-DTCMALLOC_256K_PAGES
24-
-DTCMALLOC_NUMA_AWARE
23+
-DTCMALLOC_INTERNAL_256K_PAGES
24+
-DTCMALLOC_INTERNAL_NUMA_AWARE
2525
)
2626

2727
END()

contrib/libs/tcmalloc/numa_large_pages/ya.make

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ GLOBAL_SRCS(
2020
)
2121

2222
CFLAGS(
23-
-DTCMALLOC_LARGE_PAGES
24-
-DTCMALLOC_NUMA_AWARE
23+
-DTCMALLOC_INTERNAL_32K_PAGES
24+
-DTCMALLOC_INTERNAL_NUMA_AWARE
2525
)
2626

2727
END()

contrib/libs/tcmalloc/patches/010-fork.patch

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ index 2b94ac7..8ae5e76 100644
369369
// We inherit rather than include the list as a data structure to reduce
370370
// compiler padding. Without inheritance, the compiler pads the list
371371
diff --git a/tcmalloc/transfer_cache.h b/tcmalloc/transfer_cache.h
372-
index b2b29d5..5af6dc8 100644
372+
index b2b29d5..8bc9eee 100644
373373
--- a/tcmalloc/transfer_cache.h
374374
+++ b/tcmalloc/transfer_cache.h
375375
@@ -415,6 +415,18 @@ class TransferCacheManager : public StaticForwarder {
@@ -391,6 +391,25 @@ index b2b29d5..5af6dc8 100644
391391
void InsertRange(int size_class, absl::Span<void *> batch) {
392392
cache_[size_class].tc.InsertRange(size_class, batch);
393393
}
394+
@@ -549,6 +561,18 @@ class TransferCacheManager {
395+
}
396+
}
397+
398+
+ void AcquireInternalLocks() {
399+
+ for (int i = 0; i < kNumClasses; ++i) {
400+
+ freelist_[i].AcquireInternalLocks();
401+
+ }
402+
+ }
403+
+
404+
+ void ReleaseInternalLocks() {
405+
+ for (int i = 0; i < kNumClasses; ++i) {
406+
+ freelist_[i].ReleaseInternalLocks();
407+
+ }
408+
+ }
409+
+
410+
void InsertRange(int size_class, absl::Span<void*> batch) {
411+
freelist_[size_class].InsertRange(batch);
412+
}
394413
diff --git a/tcmalloc/transfer_cache_internals.h b/tcmalloc/transfer_cache_internals.h
395414
index 2a3bd4c..d8f1031 100644
396415
--- a/tcmalloc/transfer_cache_internals.h

contrib/libs/tcmalloc/small_but_slow/ya.make

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ SRCDIR(contrib/libs/tcmalloc)
1515
INCLUDE(../common.inc)
1616

1717
CFLAGS(
18-
-DTCMALLOC_SMALL_BUT_SLOW
18+
-DTCMALLOC_INTERNAL_SMALL_BUT_SLOW
1919
)
2020

2121
END()

contrib/libs/tcmalloc/tcmalloc/transfer_cache.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,18 @@ class TransferCacheManager {
562562
}
563563
}
564564

565+
void AcquireInternalLocks() {
566+
for (int i = 0; i < kNumClasses; ++i) {
567+
freelist_[i].AcquireInternalLocks();
568+
}
569+
}
570+
571+
void ReleaseInternalLocks() {
572+
for (int i = 0; i < kNumClasses; ++i) {
573+
freelist_[i].ReleaseInternalLocks();
574+
}
575+
}
576+
565577
void InsertRange(int size_class, absl::Span<void*> batch) {
566578
freelist_[size_class].InsertRange(batch);
567579
}

contrib/libs/tcmalloc/ya.make

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ SRCS(
2020
INCLUDE(common.inc)
2121

2222
CFLAGS(
23-
-DTCMALLOC_256K_PAGES
23+
-DTCMALLOC_INTERNAL_256K_PAGES
2424
)
2525

2626
END()

0 commit comments

Comments
 (0)