Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cachelib/allocator/BackgroundEvictor-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ void BackgroundEvictor<CacheT>::checkAndRun() {
tid,pid,cid,batch);
evictions += evicted;

const size_t cid_id = (size_t)mpStats.acStats.at(cid).allocSize;
auto it = evictions_per_class_.find(cid_id);
//const size_t cid_id = (size_t)mpStats.acStats.at(cid).allocSize;
auto it = evictions_per_class_.find(cid);
if (it != evictions_per_class_.end()) {
it->second += evicted;
} else {
evictions_per_class_[cid_id] = 0;
} else if (evicted > 0) {
evictions_per_class_[cid] = evicted;
}
}

Expand Down
8 changes: 4 additions & 4 deletions cachelib/allocator/BackgroundPromoter-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ void BackgroundPromoter<CacheT>::checkAndRun() {
tid,pid,cid,batch);
promotions += promoted;

const size_t cid_id = (size_t)mpStats.acStats.at(cid).allocSize;
auto it = promotions_per_class_.find(cid_id);
//const size_t cid_id = (size_t)mpStats.acStats.at(cid).allocSize;
auto it = promotions_per_class_.find(cid);
if (it != promotions_per_class_.end()) {
it->second += promoted;
} else {
promotions_per_class_[cid_id] = 0;
} else if (promoted > 0) {
promotions_per_class_[cid] = promoted;
}
}

Expand Down
2 changes: 1 addition & 1 deletion cachelib/allocator/CacheAllocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -1899,7 +1899,7 @@ class CacheAllocator : public CacheBase {

size_t traverseAndPromoteItems(unsigned int tid, unsigned int pid, unsigned int cid, size_t batch) {
auto& mmContainer = getMMContainer(tid, pid, cid);
size_t promotions;
size_t promotions = 0;
std::vector<Item*> candidates;
candidates.reserve(batch);

Expand Down