Skip to content

Commit 0f7704a

Browse files
committed
still races
1 parent b36b7ad commit 0f7704a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cachelib/allocator/CacheAllocator-inl.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1707,6 +1707,11 @@ CacheAllocator<CacheTrait>::findEviction(TierId tid, PoolId pid, ClassId cid) {
17071707
Item* syncItem_;
17081708
//sync on the parent item for chained items to move to next tier
17091709
if (!lastTier && chainedItem_) {
1710+
if (&toRecycle_->asChainedItem().getParentItem(compressor_) !=
1711+
toRecycleParent_) {
1712+
++itr;
1713+
continue;
1714+
}
17101715
syncItem_ = toRecycleParent_;
17111716
candidate_ = toRecycle_;
17121717
XDCHECK(l_);
@@ -1740,7 +1745,7 @@ CacheAllocator<CacheTrait>::findEviction(TierId tid, PoolId pid, ClassId cid) {
17401745
// it. We could abort right here, but we need to cleanup in case
17411746
// unmarkForEviction() returns 0 - so just go through normal path.
17421747
if (!chainedItem ||
1743-
&toRecycle->asChainedItem().getParentItem(compressor_) ==
1748+
&toRecycle_->asChainedItem().getParentItem(compressor_) ==
17441749
toRecycleParent_) {
17451750
mmContainer.remove(itr);
17461751
}

0 commit comments

Comments
 (0)