@@ -1201,7 +1201,7 @@ CacheAllocator<CacheTrait>::insertOrReplace(const WriteHandle& handle) {
12011201/* Next two methods are used to asynchronously move Item between memory tiers.
12021202 *
12031203 * The thread, which moves Item, allocates new Item in the tier we are moving to
1204- * and calls moveRegularItemOnEviction () method. This method does the following:
1204+ * and calls moveRegularItemWithSync () method. This method does the following:
12051205 * 1. Create MoveCtx and put it to the movesMap.
12061206 * 2. Update the access container with the new item from the tier we are
12071207 * moving to. This Item has kIncomplete flag set.
@@ -1230,9 +1230,10 @@ bool CacheAllocator<CacheTrait>::addWaitContextForMovingItem(
12301230}
12311231
12321232template <typename CacheTrait>
1233+ template <typename P>
12331234typename CacheAllocator<CacheTrait>::WriteHandle
1234- CacheAllocator<CacheTrait>::moveRegularItemOnEviction (
1235- Item& oldItem, WriteHandle& newItemHdl) {
1235+ CacheAllocator<CacheTrait>::moveRegularItemWithSync (
1236+ Item& oldItem, WriteHandle& newItemHdl, P&& predicate ) {
12361237 XDCHECK (oldItem.isExclusive ());
12371238 // TODO: should we introduce new latency tracker. E.g. evictRegularLatency_
12381239 // ??? util::LatencyTracker tracker{stats_.evictRegularLatency_};
@@ -1292,7 +1293,7 @@ CacheAllocator<CacheTrait>::moveRegularItemOnEviction(
12921293 // it is unsafe to replace the old item with a new one, so we should
12931294 // also abort.
12941295 if (!accessContainer_->replaceIf (oldItem, *newItemHdl,
1295- itemExclusivePredicate )) {
1296+ predicate )) {
12961297 return {};
12971298 }
12981299
@@ -1649,14 +1650,14 @@ CacheAllocator<CacheTrait>::tryEvictToNextMemoryTier(
16491650
16501651 if (newItemHdl) {
16511652 XDCHECK_EQ (newItemHdl->getSize (), item.getSize ());
1652-
1653- return moveRegularItemOnEviction (item, newItemHdl);
1653+ return moveRegularItemWithSync (item, newItemHdl, itemExclusivePredicate);
16541654 }
16551655 }
16561656
16571657 return {};
16581658}
16591659
1660+
16601661template <typename CacheTrait>
16611662typename CacheAllocator<CacheTrait>::WriteHandle
16621663CacheAllocator<CacheTrait>::tryEvictToNextMemoryTier(Item& item) {
0 commit comments