diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/zencore/memory/llm.cpp | 4 | ||||
| -rw-r--r-- | src/zencore/memtrack/memorytrace.cpp | 4 | ||||
| -rw-r--r-- | src/zenstore/cache/cachedisklayer.cpp | 2 | ||||
| -rw-r--r-- | src/zenstore/compactcas.cpp | 3 |
4 files changed, 9 insertions, 4 deletions
diff --git a/src/zencore/memory/llm.cpp b/src/zencore/memory/llm.cpp index fe4853d49..61fa29a66 100644 --- a/src/zencore/memory/llm.cpp +++ b/src/zencore/memory/llm.cpp @@ -15,6 +15,7 @@ static const int32_t TagNamesBaseIndex = 256; static const int32_t TrackedTagNameCount = 256; static const char* TagNames[TrackedTagNameCount]; static uint32_t TagNameHashes[TrackedTagNameCount]; +static int32_t ParentTags[TrackedTagNameCount]; static RwLock TableLock; @@ -46,7 +47,7 @@ FLLMTag::AssignAndAnnounceNewTag(const char* TagName) for (int TagIndex = 0; TagIndex <= CurrentMaxTagIndex; ++TagIndex) { - if (TagNameHashes[TagIndex] == TagNameHash) + if (TagNameHashes[TagIndex] == TagNameHash && ParentTags[TagIndex] == m_ParentTag) { m_Tag = TagIndex + TagNamesBaseIndex; // could verify the string matches here to catch hash collisions @@ -64,6 +65,7 @@ FLLMTag::AssignAndAnnounceNewTag(const char* TagName) { TagNameHashes[TagIndex] = TagNameHash; TagNames[TagIndex] = TagName; + ParentTags[TagIndex] = m_ParentTag; } else { diff --git a/src/zencore/memtrack/memorytrace.cpp b/src/zencore/memtrack/memorytrace.cpp index 7089c356a..e4ae8148e 100644 --- a/src/zencore/memtrack/memorytrace.cpp +++ b/src/zencore/memtrack/memorytrace.cpp @@ -41,8 +41,8 @@ void MemoryTrace_EnableTracePump(); //////////////////////////////////////////////////////////////////////////////// namespace { -// Controls how often time markers are emitted (default: every 4095 allocations). -constexpr uint32_t MarkerSamplePeriod = (4 << 10) - 1; +// Controls how often time markers are emitted (must be POW2-1 as this is used as a mask) +constexpr uint32_t MarkerSamplePeriod = 128 - 1; // Number of shifted bits to SizeLower constexpr uint32_t SizeShift = 3; diff --git a/src/zenstore/cache/cachedisklayer.cpp b/src/zenstore/cache/cachedisklayer.cpp index 9f09713ee..cbc1d6e83 100644 --- a/src/zenstore/cache/cachedisklayer.cpp +++ b/src/zenstore/cache/cachedisklayer.cpp @@ -1267,6 +1267,7 @@ ZenCacheDiskLayer::CacheBucket::EndPutBatch(PutBatchHandle* Batch) noexcept size_t IndexOffset = 0; m_BlockStore.WriteChunks(Batch->Buffers, m_Configuration.PayloadAlignment, [&](std::span<BlockStoreLocation> Locations) { + ZEN_MEMSCOPE(GetCacheDiskTag()); std::vector<DiskIndexEntry> DiskEntries; { RwLock::ExclusiveLockScope IndexLock(m_IndexLock); @@ -2679,6 +2680,7 @@ ZenCacheDiskLayer::CacheBucket::PutInlineCacheValue(const IoHash& HashKey, Value.Value.Size(), m_Configuration.PayloadAlignment, [&](const BlockStoreLocation& BlockStoreLocation) { + ZEN_MEMSCOPE(GetCacheDiskTag()); ZEN_TRACE_CPU("Z$::Bucket::UpdateLocation"); DiskLocation Location(BlockStoreLocation, m_Configuration.PayloadAlignment, EntryFlags); m_SlogFile.Append({.Key = HashKey, .Location = Location}); diff --git a/src/zenstore/compactcas.cpp b/src/zenstore/compactcas.cpp index 30cf998f8..2be0542db 100644 --- a/src/zenstore/compactcas.cpp +++ b/src/zenstore/compactcas.cpp @@ -199,6 +199,7 @@ CasContainerStrategy::InsertChunk(const void* ChunkData, size_t ChunkSize, const // reads, insert and GC. m_BlockStore.WriteChunk(ChunkData, ChunkSize, m_PayloadAlignment, [&](const BlockStoreLocation& Location) { + ZEN_MEMSCOPE(GetCasContainerTag()); ZEN_TRACE_CPU("CasContainer::UpdateLocation"); BlockStoreDiskLocation DiskLocation(Location, m_PayloadAlignment); const CasDiskIndexEntry IndexEntry{.Key = ChunkHash, .Location = DiskLocation}; @@ -232,7 +233,6 @@ CasContainerStrategy::InsertChunks(std::span<IoBuffer> Chunks, std::span<IoHash> ZEN_ASSERT(Chunks.size() == ChunkHashes.size()); std::vector<CasStore::InsertResult> Result(Chunks.size()); std::vector<size_t> NewChunkIndexes; - Result.reserve(Chunks.size()); { RwLock::SharedLockScope _(m_LocationMapLock); for (size_t ChunkIndex = 0; ChunkIndex < ChunkHashes.size(); ChunkIndex++) @@ -264,6 +264,7 @@ CasContainerStrategy::InsertChunks(std::span<IoBuffer> Chunks, std::span<IoHash> size_t ChunkOffset = 0; m_BlockStore.WriteChunks(Datas, m_PayloadAlignment, [&](std::span<BlockStoreLocation> Locations) { + ZEN_MEMSCOPE(GetCasContainerTag()); std::vector<CasDiskIndexEntry> IndexEntries; for (const BlockStoreLocation& Location : Locations) { |