diff options
| author | Dan Engelbrecht <[email protected]> | 2022-05-02 17:06:30 +0200 |
|---|---|---|
| committer | Dan Engelbrecht <[email protected]> | 2022-05-02 17:06:30 +0200 |
| commit | 1e3da36ef01f6b823febf22645a314267353a223 (patch) | |
| tree | 60f2a2b5f680cc04e6546bf4aaf7e0d94ad1632a /zenserver/cache/structuredcachestore.cpp | |
| parent | clean up any incomplete blocks if ReclaimSpace fails (diff) | |
| download | zen-1e3da36ef01f6b823febf22645a314267353a223.tar.xz zen-1e3da36ef01f6b823febf22645a314267353a223.zip | |
switched back memory_order for m_TotalSize to relaxed
Diffstat (limited to 'zenserver/cache/structuredcachestore.cpp')
| -rw-r--r-- | zenserver/cache/structuredcachestore.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/zenserver/cache/structuredcachestore.cpp b/zenserver/cache/structuredcachestore.cpp index a9e9b8f78..ae3b401a5 100644 --- a/zenserver/cache/structuredcachestore.cpp +++ b/zenserver/cache/structuredcachestore.cpp @@ -567,7 +567,7 @@ ZenCacheMemoryLayer::CacheBucket::Put(const IoHash& HashKey, const ZenCacheValue m_CacheMap.insert_or_assign(HashKey, BucketValue(Value.Value, GcClock::TickCount())); } - m_TotalSize.fetch_add(Value.Value.GetSize(), std::memory_order_seq_cst); + m_TotalSize.fetch_add(Value.Value.GetSize(), std::memory_order::relaxed); } ////////////////////////////////////////////////////////////////////////// @@ -1088,7 +1088,7 @@ ZenCacheDiskLayer::CacheBucket::OpenLog(const fs::path& BucketDir, const bool Is for (const auto& Entry : m_Index) { const DiskLocation& Location = Entry.second.Location; - m_TotalSize.fetch_add(Location.Size(), std::memory_order_seq_cst); + m_TotalSize.fetch_add(Location.Size(), std::memory_order::relaxed); if (Location.IsFlagSet(DiskLocation::kStandaloneFile)) { continue; @@ -1554,10 +1554,10 @@ ZenCacheDiskLayer::CacheBucket::CollectGarbage(GcContext& GcCtx) } m_SlogFile.Append(DiskIndexEntry{.Key = Key, .Location = RestoreLocation}); m_Index.insert({Key, {Loc, GcClock::TickCount()}}); - m_TotalSize.fetch_add(Entry.Location.Size(), std::memory_order_seq_cst); + m_TotalSize.fetch_add(Entry.Location.Size(), std::memory_order::relaxed); continue; } - m_TotalSize.fetch_sub(Entry.Location.Size(), std::memory_order_seq_cst); + m_TotalSize.fetch_sub(Entry.Location.Size(), std::memory_order::relaxed); DeletedSize += Entry.Location.Size(); DeletedCount++; } @@ -1815,7 +1815,7 @@ ZenCacheDiskLayer::CacheBucket::PutStandaloneCacheValue(const IoHash& HashKey, c } m_SlogFile.Append({.Key = HashKey, .Location = Loc}); - m_TotalSize.fetch_add(Loc.Size(), std::memory_order_seq_cst); + m_TotalSize.fetch_add(Loc.Size(), std::memory_order::relaxed); } void @@ -1836,7 +1836,7 @@ ZenCacheDiskLayer::CacheBucket::PutInlineCacheValue(const IoHash& HashKey, const DiskLocation Location(BlockStoreLocation, m_PayloadAlignment, EntryFlags); const DiskIndexEntry DiskIndexEntry{.Key = HashKey, .Location = Location}; m_SlogFile.Append(DiskIndexEntry); - m_TotalSize.fetch_add(BlockStoreLocation.Size, std::memory_order_seq_cst); + m_TotalSize.fetch_add(BlockStoreLocation.Size, std::memory_order::relaxed); RwLock::ExclusiveLockScope __(m_IndexLock); if (auto It = m_Index.find(HashKey); It != m_Index.end()) { |