@@ -1242,7 +1242,7 @@ CacheAllocator<CacheTrait>::insertOrReplace(const ItemHandle& handle) {
12421242/* Next two methods are used to asynchronously move Item between memory tiers.
12431243 *
12441244 * The thread, which moves Item, allocates new Item in the tier we are moving to
1245- * and calls moveRegularItemOnEviction () method. This method does the following:
1245+ * and calls moveRegularItemWithSync () method. This method does the following:
12461246 * 1. Create MoveCtx and put it to the movesMap.
12471247 * 2. Update the access container with the new item from the tier we are
12481248 * moving to. This Item has kIncomplete flag set.
@@ -1271,9 +1271,10 @@ bool CacheAllocator<CacheTrait>::addWaitContextForMovingItem(
12711271}
12721272
12731273template <typename CacheTrait>
1274+ template <typename P>
12741275typename CacheAllocator<CacheTrait>::ItemHandle
1275- CacheAllocator<CacheTrait>::moveRegularItemOnEviction (
1276- Item& oldItem, ItemHandle& newItemHdl) {
1276+ CacheAllocator<CacheTrait>::moveRegularItemWithSync (
1277+ Item& oldItem, ItemHandle& newItemHdl, P&& predicate ) {
12771278 XDCHECK (oldItem.isMoving ());
12781279 // TODO: should we introduce new latency tracker. E.g. evictRegularLatency_
12791280 // ??? util::LatencyTracker tracker{stats_.evictRegularLatency_};
@@ -1333,7 +1334,7 @@ CacheAllocator<CacheTrait>::moveRegularItemOnEviction(
13331334 // it is unsafe to replace the old item with a new one, so we should
13341335 // also abort.
13351336 if (!accessContainer_->replaceIf (oldItem, *newItemHdl,
1336- itemMovingPredicate )) {
1337+ predicate )) {
13371338 return {};
13381339 }
13391340
@@ -1707,7 +1708,7 @@ CacheAllocator<CacheTrait>::tryEvictToNextMemoryTier(
17071708
17081709 if (newItemHdl) {
17091710 XDCHECK_EQ (newItemHdl->getSize (), item.getSize ());
1710- return moveRegularItemOnEviction (item, newItemHdl);
1711+ return moveRegularItemWithSync (item, newItemHdl, itemMovingPredicate );
17111712 }
17121713 }
17131714
0 commit comments