@@ -1193,7 +1193,7 @@ CacheAllocator<CacheTrait>::insertOrReplace(const WriteHandle& handle) {
11931193/* Next two methods are used to asynchronously move Item between memory tiers.
11941194 *
11951195 * The thread, which moves Item, allocates new Item in the tier we are moving to
1196- * and calls moveRegularItemOnEviction () method. This method does the following:
1196+ * and calls moveRegularItemWithSync () method. This method does the following:
11971197 * 1. Create MoveCtx and put it to the movesMap.
11981198 * 2. Update the access container with the new item from the tier we are
11991199 * moving to. This Item has kIncomplete flag set.
@@ -1222,9 +1222,10 @@ bool CacheAllocator<CacheTrait>::addWaitContextForMovingItem(
12221222}
12231223
12241224template <typename CacheTrait>
1225+ template <typename P>
12251226typename CacheAllocator<CacheTrait>::WriteHandle
1226- CacheAllocator<CacheTrait>::moveRegularItemOnEviction (
1227- Item& oldItem, WriteHandle& newItemHdl) {
1227+ CacheAllocator<CacheTrait>::moveRegularItemWithSync (
1228+ Item& oldItem, WriteHandle& newItemHdl, P&& predicate ) {
12281229 XDCHECK (oldItem.isMoving ());
12291230 // TODO: should we introduce new latency tracker. E.g. evictRegularLatency_
12301231 // ??? util::LatencyTracker tracker{stats_.evictRegularLatency_};
@@ -1284,7 +1285,7 @@ CacheAllocator<CacheTrait>::moveRegularItemOnEviction(
12841285 // it is unsafe to replace the old item with a new one, so we should
12851286 // also abort.
12861287 if (!accessContainer_->replaceIf (oldItem, *newItemHdl,
1287- itemMovingPredicate )) {
1288+ predicate )) {
12881289 return {};
12891290 }
12901291
@@ -1652,14 +1653,14 @@ CacheAllocator<CacheTrait>::tryEvictToNextMemoryTier(
16521653
16531654 if (newItemHdl) {
16541655 XDCHECK_EQ (newItemHdl->getSize (), item.getSize ());
1655-
1656- return moveRegularItemOnEviction (item, newItemHdl);
1656+ return moveRegularItemWithSync (item, newItemHdl, itemMovingPredicate);
16571657 }
16581658 }
16591659
16601660 return {};
16611661}
16621662
1663+
16631664template <typename CacheTrait>
16641665typename CacheAllocator<CacheTrait>::WriteHandle
16651666CacheAllocator<CacheTrait>::tryEvictToNextMemoryTier(Item& item) {
0 commit comments