@@ -1175,7 +1175,7 @@ CacheAllocator<CacheTrait>::insertOrReplace(const ItemHandle& handle) {
1175
1175
/* Next two methods are used to asynchronously move Item between memory tiers.
1176
1176
*
1177
1177
* The thread, which moves Item, allocates new Item in the tier we are moving to
1178
- * and calls moveRegularItemOnEviction () method. This method does the following:
1178
+ * and calls moveRegularItemWithSync () method. This method does the following:
1179
1179
* 1. Create MoveCtx and put it to the movesMap.
1180
1180
* 2. Update the access container with the new item from the tier we are
1181
1181
* moving to. This Item has kIncomplete flag set.
@@ -1204,9 +1204,10 @@ bool CacheAllocator<CacheTrait>::addWaitContextForMovingItem(
1204
1204
}
1205
1205
1206
1206
template <typename CacheTrait>
1207
+ template <typename P>
1207
1208
typename CacheAllocator<CacheTrait>::ItemHandle
1208
- CacheAllocator<CacheTrait>::moveRegularItemOnEviction (
1209
- Item& oldItem, ItemHandle& newItemHdl) {
1209
+ CacheAllocator<CacheTrait>::moveRegularItemWithSync (
1210
+ Item& oldItem, ItemHandle& newItemHdl, P&& predicate ) {
1210
1211
XDCHECK (oldItem.isMoving ());
1211
1212
// TODO: should we introduce new latency tracker. E.g. evictRegularLatency_
1212
1213
// ??? util::LatencyTracker tracker{stats_.evictRegularLatency_};
@@ -1266,7 +1267,7 @@ CacheAllocator<CacheTrait>::moveRegularItemOnEviction(
1266
1267
// it is unsafe to replace the old item with a new one, so we should
1267
1268
// also abort.
1268
1269
if (!accessContainer_->replaceIf (oldItem, *newItemHdl,
1269
- itemMovingPredicate )) {
1270
+ predicate )) {
1270
1271
return {};
1271
1272
}
1272
1273
@@ -1626,8 +1627,7 @@ CacheAllocator<CacheTrait>::tryEvictToNextMemoryTier(
1626
1627
1627
1628
if (newItemHdl) {
1628
1629
XDCHECK_EQ (newItemHdl->getSize (), item.getSize ());
1629
-
1630
- return moveRegularItemOnEviction (item, newItemHdl);
1630
+ return moveRegularItemWithSync (item, newItemHdl, itemMovingPredicate);
1631
1631
}
1632
1632
}
1633
1633
0 commit comments