Commit ad230ca8 authored by Nitin Garg's avatar Nitin Garg Committed by Facebook GitHub Bot

Skip TSAN annotations for SharedMutex in Digest

Summary:
The slowdown from the tracking is making long running tests that also
exercise it heavily to time out.

Reviewed By: yfeldblum

Differential Revision: D31715944

fbshipit-source-id: 2b4354242dd035c2a4ba69a2aa3e05f2196ae949
parent 1891a99d
......@@ -37,7 +37,7 @@ DigestT DigestBuilder<DigestT>::build() {
digestPtrs.reserve(cpuLocalBuffers_.size());
for (auto& cpuLocalBuffer : cpuLocalBuffers_) {
std::unique_lock<SharedMutex> g(cpuLocalBuffer.mutex);
std::unique_lock<SharedMutexSuppressTSAN> g(cpuLocalBuffer.mutex);
valuesVec.push_back(std::move(cpuLocalBuffer.buffer));
if (cpuLocalBuffer.digest) {
digestPtrs.push_back(std::move(cpuLocalBuffer.digest));
......@@ -70,7 +70,7 @@ template <typename DigestT>
void DigestBuilder<DigestT>::append(double value) {
auto cpuLocalBuf = &cpuLocalBuffers_[AccessSpreader<>::cachedCurrent(
cpuLocalBuffers_.size())];
std::unique_lock<SharedMutex> g(cpuLocalBuf->mutex);
std::unique_lock<SharedMutexSuppressTSAN> g(cpuLocalBuf->mutex);
cpuLocalBuf->buffer.push_back(value);
if (cpuLocalBuf->buffer.size() == bufferSize_) {
if (!cpuLocalBuf->digest) {
......
......@@ -55,7 +55,7 @@ class DigestBuilder {
private:
struct alignas(hardware_destructive_interference_size) CpuLocalBuffer {
public:
mutable SharedMutex mutex;
mutable SharedMutexSuppressTSAN mutex;
std::vector<double> buffer;
std::unique_ptr<DigestT> digest;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment