Skip to content

Commit d3b1607

Browse files
authored
Merge pull request #12215 from ydb-platform/mergelibs-241202-1453
Library import 241202-1453
2 parents 76b069c + c98e881 commit d3b1607

File tree

406 files changed

+1079
-2950
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

406 files changed

+1079
-2950
lines changed

build/mapping.conf.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,8 @@
450450
"7480276291": "https://devtools-registry.s3.yandex.net/7480276291",
451451
"7537937986": "https://devtools-registry.s3.yandex.net/7537937986",
452452
"7538005601": "https://devtools-registry.s3.yandex.net/7538005601",
453+
"7573694143": "https://devtools-registry.s3.yandex.net/7573694143",
454+
"7573699373": "https://devtools-registry.s3.yandex.net/7573699373",
453455
"5486731632": "https://devtools-registry.s3.yandex.net/5486731632",
454456
"5514350352": "https://devtools-registry.s3.yandex.net/5514350352",
455457
"5514360398": "https://devtools-registry.s3.yandex.net/5514360398",
@@ -1514,6 +1516,8 @@
15141516
"7480276291": "devtools/ya/test/programs/test_tool/bin/test_tool for linux",
15151517
"7537937986": "devtools/ya/test/programs/test_tool/bin/test_tool for linux",
15161518
"7538005601": "devtools/ya/test/programs/test_tool/bin/test_tool for linux",
1519+
"7573694143": "devtools/ya/test/programs/test_tool/bin/test_tool for linux",
1520+
"7573699373": "devtools/ya/test/programs/test_tool/bin/test_tool for linux",
15171521
"5486731632": "devtools/ya/test/programs/test_tool/bin3/test_tool3 for linux",
15181522
"5514350352": "devtools/ya/test/programs/test_tool/bin3/test_tool3 for linux",
15191523
"5514360398": "devtools/ya/test/programs/test_tool/bin3/test_tool3 for linux",
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
IF (HOST_OS_DARWIN AND HOST_ARCH_X86_64)
2-
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7538003967)
2+
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7573697889)
33
ELSEIF (HOST_OS_DARWIN AND HOST_ARCH_ARM64)
4-
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7538003163)
4+
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7573697448)
55
ELSEIF (HOST_OS_LINUX AND HOST_ARCH_X86_64)
6-
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7538005601)
6+
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7573699373)
77
ELSEIF (HOST_OS_LINUX AND HOST_ARCH_AARCH64)
8-
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7538002456)
8+
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7573696869)
99
ELSEIF (HOST_OS_WINDOWS AND HOST_ARCH_X86_64)
10-
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7538004884)
10+
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7573698723)
1111

1212
ENDIF()
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
IF (HOST_OS_DARWIN AND HOST_ARCH_X86_64)
2-
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7537936527)
2+
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7573693387)
33
ELSEIF (HOST_OS_DARWIN AND HOST_ARCH_ARM64)
4-
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7537935343)
4+
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7573692847)
55
ELSEIF (HOST_OS_LINUX AND HOST_ARCH_X86_64)
6-
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7537937986)
6+
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7573694143)
77
ELSEIF (HOST_OS_LINUX AND HOST_ARCH_AARCH64)
8-
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7537934380)
8+
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7573692312)
99
ELSEIF (HOST_OS_WINDOWS AND HOST_ARCH_X86_64)
10-
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7537937248)
10+
DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:7573693816)
1111

1212
ENDIF()

contrib/libs/clang18-rt/lib/msan/msan_flags.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ MSAN_FLAG(bool, poison_stack_with_zeroes, false, "")
2525
MSAN_FLAG(bool, poison_in_malloc, true, "")
2626
MSAN_FLAG(bool, poison_in_free, true, "")
2727
MSAN_FLAG(bool, poison_in_dtor, true, "")
28-
MSAN_FLAG(bool, report_umrs, false, "")
28+
MSAN_FLAG(bool, report_umrs, true, "")
2929
MSAN_FLAG(bool, wrap_signals, true, "")
3030
MSAN_FLAG(bool, print_stats, false, "")
3131
MSAN_FLAG(bool, halt_on_error, !&__msan_keep_going, "")

library/cpp/tld/tlds-alpha-by-domain.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Version 2024112800, Last Updated Thu Nov 28 07:07:01 2024 UTC
1+
# Version 2024120100, Last Updated Sun Dec 1 07:07:01 2024 UTC
22
AAA
33
AARP
44
ABB

library/cpp/yt/stockpile/stockpile.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,13 @@ struct TStockpileOptions
3939

4040
////////////////////////////////////////////////////////////////////////////////
4141

42-
void RunStockpileThread(TStockpileOptions options, std::atomic<bool>* shouldProceed);
43-
44-
void RunDetachedStockpileThreads(TStockpileOptions options);
42+
class TStockpileManager
43+
{
44+
public:
45+
//! Configures the background stockpile threads.
46+
//! Safe to call multiple times.
47+
static void Reconfigure(TStockpileOptions options);
48+
};
4549

4650
////////////////////////////////////////////////////////////////////////////////
4751

library/cpp/yt/stockpile/stockpile_linux.cpp

Lines changed: 115 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,119 +1,156 @@
11
#include "stockpile.h"
22

3-
#include "library/cpp/yt/logging/logger.h"
3+
#include <library/cpp/yt/threading/spin_lock.h>
4+
5+
#include <library/cpp/yt/misc/global.h>
6+
7+
#include <library/cpp/yt/memory/leaky_singleton.h>
8+
9+
#include <library/cpp/yt/logging/logger.h>
410

511
#include <thread>
6-
#include <mutex>
712

813
#include <sys/mman.h>
914

1015
#include <util/system/thread.h>
16+
1117
#include <string.h>
1218

1319
namespace NYT {
1420

1521
////////////////////////////////////////////////////////////////////////////////
1622

17-
static const auto Logger = NLogging::TLogger("Stockpile");
23+
namespace {
1824

25+
YT_DEFINE_GLOBAL(const NLogging::TLogger, Logger, "Stockpile");
1926
constexpr int MADV_STOCKPILE = 0x59410004;
2027

21-
////////////////////////////////////////////////////////////////////////////////
22-
23-
namespace {
28+
} // namespace
2429

25-
void RunWithFixedBreaks(i64 bufferSize, TDuration period)
30+
class TStockpileManagerImpl
2631
{
27-
auto returnCode = -::madvise(nullptr, bufferSize, MADV_STOCKPILE);
28-
YT_LOG_DEBUG_IF(returnCode, "System call \"madvise\" failed: %v", strerror(returnCode));
29-
Sleep(period);
30-
}
32+
public:
33+
static TStockpileManagerImpl* Get()
34+
{
35+
return LeakySingleton<TStockpileManagerImpl>();
36+
}
3137

32-
void RunWithCappedLoad(i64 bufferSize, TDuration period)
33-
{
34-
auto started = GetApproximateCpuInstant();
35-
auto returnCode = -::madvise(nullptr, bufferSize, MADV_STOCKPILE);
36-
YT_LOG_DEBUG_IF(returnCode, "System call \"madvise\" failed: %v", strerror(returnCode));
37-
auto duration = CpuDurationToDuration(GetApproximateCpuInstant() - started);
38+
void Reconfigure(TStockpileOptions options)
39+
{
40+
auto guard = Guard(SpinLock_);
41+
42+
Run_.store(false);
43+
for (const auto& thread : Threads_) {
44+
thread->join();
45+
}
46+
47+
Threads_.clear();
48+
Run_.store(true);
3849

39-
if (duration < period) {
40-
Sleep(period - duration);
50+
Options_ = options;
51+
52+
for (int threadIndex = 0; threadIndex < Options_.ThreadCount; ++threadIndex) {
53+
Threads_.push_back(std::make_unique<std::thread>(&TStockpileManagerImpl::ThreadMain, this));
54+
}
4155
}
42-
}
4356

44-
std::pair<i64, TDuration> RunWithBackoffs(
45-
i64 adjustedBufferSize,
46-
TDuration adjustedPeriod,
47-
const TStockpileOptions& options,
48-
i64 pageSize)
49-
{
50-
int returnCode = -::madvise(nullptr, adjustedBufferSize, MADV_STOCKPILE);
51-
YT_LOG_DEBUG_IF(returnCode, "System call \"madvise\" failed: %v", strerror(returnCode));
52-
53-
switch(returnCode) {
54-
case 0:
55-
Sleep(options.Period);
56-
return {options.BufferSize, options.Period};
57-
58-
case ENOMEM:
59-
if (adjustedBufferSize / 2 >= pageSize) {
60-
// Immediately make an attempt to reclaim half as much.
61-
adjustedBufferSize = adjustedBufferSize / 2;
62-
} else {
63-
// Unless there is not even a single reclaimable page.
64-
Sleep(options.Period);
65-
}
66-
return {adjustedBufferSize, options.Period};
57+
private:
58+
DECLARE_LEAKY_SINGLETON_FRIEND();
59+
60+
const i64 PageSize_ = sysconf(_SC_PAGESIZE);
61+
62+
YT_DECLARE_SPIN_LOCK(NThreading::TSpinLock, SpinLock_);
63+
std::vector<std::unique_ptr<std::thread>> Threads_;
64+
TStockpileOptions Options_;
65+
std::atomic<bool> Run_ = false;
66+
67+
void ThreadMain()
68+
{
69+
TThread::SetCurrentThreadName("Stockpile");
70+
71+
auto bufferSize = Options_.BufferSize;
72+
auto period = Options_.Period;
6773

68-
case EAGAIN:
69-
case EINTR:
70-
Sleep(adjustedPeriod);
71-
return {options.BufferSize, adjustedPeriod + options.Period};
74+
while (Run_.load()) {
75+
switch (Options_.Strategy) {
76+
case EStockpileStrategy::FixedBreaks:
77+
RunWithFixedBreaks(Options_.BufferSize, Options_.Period);
78+
break;
7279

73-
default:
74-
Sleep(options.Period);
75-
return {options.BufferSize, options.Period};
80+
case EStockpileStrategy::FlooredLoad:
81+
RunWithCappedLoad(Options_.BufferSize, Options_.Period);
82+
break;
83+
84+
case EStockpileStrategy::ProgressiveBackoff:
85+
std::tie(bufferSize, period) = RunWithBackoffs(bufferSize, period);
86+
break;
87+
88+
default:
89+
YT_ABORT();
90+
}
91+
}
7692
}
77-
}
7893

79-
} // namespace
94+
void RunWithFixedBreaks(i64 bufferSize, TDuration period)
95+
{
96+
auto returnCode = -::madvise(nullptr, bufferSize, MADV_STOCKPILE);
97+
YT_LOG_DEBUG_IF(returnCode != 0, "System call \"madvise\" failed: %v", strerror(returnCode));
8098

81-
void RunStockpileThread(TStockpileOptions options, std::atomic<bool>* shouldProceed)
82-
{
83-
TThread::SetCurrentThreadName("Stockpile");
99+
Sleep(period);
100+
}
84101

85-
const i64 pageSize = sysconf(_SC_PAGESIZE);
86-
auto bufferSize = options.BufferSize;
87-
auto period = options.Period;
102+
void RunWithCappedLoad(i64 bufferSize, TDuration period)
103+
{
104+
auto started = GetApproximateCpuInstant();
88105

89-
while (!shouldProceed || shouldProceed->load()) {
90-
switch (options.Strategy) {
91-
case EStockpileStrategy::FixedBreaks:
92-
RunWithFixedBreaks(options.BufferSize, options.Period);
93-
break;
106+
auto returnCode = -::madvise(nullptr, bufferSize, MADV_STOCKPILE);
107+
YT_LOG_DEBUG_IF(returnCode != 0, "System call \"madvise\" failed: %v", strerror(returnCode));
94108

95-
case EStockpileStrategy::FlooredLoad:
96-
RunWithCappedLoad(options.BufferSize, options.Period);
97-
break;
109+
auto duration = CpuDurationToDuration(GetApproximateCpuInstant() - started);
110+
if (duration < period) {
111+
Sleep(period - duration);
112+
}
113+
}
98114

99-
case EStockpileStrategy::ProgressiveBackoff:
100-
std::tie(bufferSize, period) = RunWithBackoffs(bufferSize, period, options, pageSize);
101-
break;
115+
std::pair<i64, TDuration> RunWithBackoffs(
116+
i64 adjustedBufferSize,
117+
TDuration adjustedPeriod)
118+
{
119+
int returnCode = -::madvise(nullptr, adjustedBufferSize, MADV_STOCKPILE);
120+
YT_LOG_DEBUG_IF(returnCode != 0, "System call \"madvise\" failed: %v", strerror(returnCode));
121+
122+
switch(returnCode) {
123+
case 0:
124+
Sleep(Options_.Period);
125+
return {Options_.BufferSize, Options_.Period};
126+
127+
case ENOMEM:
128+
if (adjustedBufferSize / 2 >= PageSize_) {
129+
// Immediately make an attempt to reclaim half as much.
130+
adjustedBufferSize = adjustedBufferSize / 2;
131+
} else {
132+
// Unless there is not even a single reclaimable page.
133+
Sleep(Options_.Period);
134+
}
135+
return {adjustedBufferSize, Options_.Period};
136+
137+
case EAGAIN:
138+
case EINTR:
139+
Sleep(adjustedPeriod);
140+
return {Options_.BufferSize, adjustedPeriod + Options_.Period};
102141

103142
default:
104-
YT_ABORT();
143+
Sleep(Options_.Period);
144+
return {Options_.BufferSize, Options_.Period};
105145
}
106146
}
107-
}
147+
};
148+
149+
////////////////////////////////////////////////////////////////////////////////
108150

109-
void RunDetachedStockpileThreads(TStockpileOptions options)
151+
void TStockpileManager::Reconfigure(TStockpileOptions options)
110152
{
111-
static std::once_flag OnceFlag;
112-
std::call_once(OnceFlag, [options = std::move(options)] {
113-
for (int i = 0; i < options.ThreadCount; ++i) {
114-
std::thread(RunStockpileThread, options, nullptr).detach();
115-
}
116-
});
153+
TStockpileManagerImpl::Get()->Reconfigure(std::move(options));
117154
}
118155

119156
////////////////////////////////////////////////////////////////////////////////

library/cpp/yt/stockpile/stockpile_other.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ namespace NYT {
44

55
////////////////////////////////////////////////////////////////////////////////
66

7-
void RunStockpileThread(TStockpileOptions /*options*/, std::atomic<bool>* /*shouldProceed*/)
8-
{ }
9-
10-
void RunDetachedStockpileThreads(TStockpileOptions /*options*/)
7+
void TStockpileManager::Reconfigure(TStockpileOptions /*options*/)
118
{ }
129

1310
////////////////////////////////////////////////////////////////////////////////

library/cpp/yt/stockpile/ya.make

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,11 @@ ELSE()
88
SRCS(stockpile_other.cpp)
99
ENDIF()
1010

11+
PEERDIR(
12+
library/cpp/yt/misc
13+
library/cpp/yt/threading
14+
library/cpp/yt/logging
15+
library/cpp/yt/memory
16+
)
17+
1118
END()

ya

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,33 +39,33 @@ REGISTRY_ENDPOINT = os.environ.get("YA_REGISTRY_ENDPOINT", "https://devtools-reg
3939
PLATFORM_MAP = {
4040
"data": {
4141
"darwin": {
42-
"md5": "0315330907e0eea53b99727ff66e5cc7",
42+
"md5": "8f73547bbb30217587e27e30be05bca6",
4343
"urls": [
44-
f"{REGISTRY_ENDPOINT}/7537984539"
44+
f"{REGISTRY_ENDPOINT}/7573718003"
4545
]
4646
},
4747
"darwin-arm64": {
48-
"md5": "9f26f851069215b6c7d230250e341ddc",
48+
"md5": "7609c99e83652c94a8be59194f895992",
4949
"urls": [
50-
f"{REGISTRY_ENDPOINT}/7537983776"
50+
f"{REGISTRY_ENDPOINT}/7573716990"
5151
]
5252
},
5353
"linux-aarch64": {
54-
"md5": "fd9640906f78e85bcda2fb9c39b77933",
54+
"md5": "df6d7d3ae6830d5d1383746b9dba2e21",
5555
"urls": [
56-
f"{REGISTRY_ENDPOINT}/7537982986"
56+
f"{REGISTRY_ENDPOINT}/7573715788"
5757
]
5858
},
5959
"win32-clang-cl": {
60-
"md5": "9734b0100024a13d731199606eabcfce",
60+
"md5": "a48d5651a2c9aa7dbbf58384584af599",
6161
"urls": [
62-
f"{REGISTRY_ENDPOINT}/7537985111"
62+
f"{REGISTRY_ENDPOINT}/7573718783"
6363
]
6464
},
6565
"linux": {
66-
"md5": "ee84a2e88d0d892d4f451d650b90da8e",
66+
"md5": "ad166d3e87a875422d6073227cf5800a",
6767
"urls": [
68-
f"{REGISTRY_ENDPOINT}/7537985768"
68+
f"{REGISTRY_ENDPOINT}/7573719525"
6969
]
7070
}
7171
}

0 commit comments

Comments
 (0)