@@ -372,8 +372,7 @@ CacheAllocator<CacheTrait>::allocateInternalTier(TierId tid,
372372 typename Item::Key key,
373373 uint32_t size,
374374 uint32_t creationTime,
375- uint32_t expiryTime,
376- bool fromEvictorThread) {
375+ uint32_t expiryTime) {
377376 util::LatencyTracker tracker{stats ().allocateLatency_ };
378377
379378 SCOPE_FAIL { stats_.invalidAllocs .inc (); };
@@ -403,7 +402,7 @@ CacheAllocator<CacheTrait>::allocateInternalTier(TierId tid,
403402 }
404403
405404 // TODO: Today disableEviction means do not evict from memory (DRAM).
406- // Should we support eviction between memory tiers (e.g. from DRAM to PMEM )?
405+ // Should we support eviction between memory tiers (e.g. from DRAM to next tier )?
407406 if (memory == nullptr && !config_.disableEviction ) {
408407 memory = findEviction (tid, pid, cid);
409408 }
@@ -475,7 +474,7 @@ CacheAllocator<CacheTrait>::getTargetTierForItem(PoolId pid,
475474 if (freePercentage <= config_.minAcAllocationWatermark )
476475 return defaultTargetTier + 1 ;
477476
478- // TODO: we can even think about creating different allocation classes for PMEM
477+ // TODO: we can even think about creating different allocation classes for different tiers
479478 // and we could look at possible fragmentation when deciding where to put the item
480479 if (config_.sizeThresholdPolicy )
481480 return requiredSize < config_.sizeThresholdPolicy ? defaultTargetTier : defaultTargetTier + 1 ;
@@ -506,10 +505,9 @@ CacheAllocator<CacheTrait>::allocateInternal(PoolId pid,
506505 typename Item::Key key,
507506 uint32_t size,
508507 uint32_t creationTime,
509- uint32_t expiryTime,
510- bool fromEvictorThread) {
508+ uint32_t expiryTime) {
511509 auto tid = getTargetTierForItem (pid, key, size, creationTime, expiryTime);
512- return allocateInternalTier (tid, pid, key, size, creationTime, expiryTime, fromEvictorThread );
510+ return allocateInternalTier (tid, pid, key, size, creationTime, expiryTime);
513511}
514512
515513template <typename CacheTrait>
@@ -1680,17 +1678,13 @@ template <typename CacheTrait>
16801678bool CacheAllocator<CacheTrait>::shouldEvictToNextMemoryTier(
16811679 TierId sourceTierId, TierId targetTierId, PoolId pid, Item& item)
16821680{
1683- if (config_.disableEvictionToMemory )
1684- return false ;
1685-
1686- // TODO: implement more advanced admission policies for memory tiers
1687- return true ;
1681+ return !(config_.disableEvictionToMemory );
16881682}
16891683
16901684template <typename CacheTrait>
16911685typename CacheAllocator<CacheTrait>::WriteHandle
16921686CacheAllocator<CacheTrait>::tryEvictToNextMemoryTier(
1693- TierId tid, PoolId pid, Item& item, bool fromEvictorThread ) {
1687+ TierId tid, PoolId pid, Item& item) {
16941688 if (item.isExpired ()) return acquire (&item);
16951689
16961690 TierId nextTier = tid;
@@ -1703,8 +1697,7 @@ CacheAllocator<CacheTrait>::tryEvictToNextMemoryTier(
17031697 item.getKey (),
17041698 item.getSize (),
17051699 item.getCreationTime (),
1706- item.getExpiryTime (),
1707- fromEvictorThread);
1700+ item.getExpiryTime ());
17081701
17091702 if (newItemHdl) {
17101703 XDCHECK_EQ (newItemHdl->getSize (), item.getSize ());
@@ -1717,10 +1710,10 @@ CacheAllocator<CacheTrait>::tryEvictToNextMemoryTier(
17171710
17181711template <typename CacheTrait>
17191712typename CacheAllocator<CacheTrait>::WriteHandle
1720- CacheAllocator<CacheTrait>::tryEvictToNextMemoryTier(Item& item, bool fromEvictorThread ) {
1713+ CacheAllocator<CacheTrait>::tryEvictToNextMemoryTier(Item& item) {
17211714 auto tid = getTierId (item);
17221715 auto pid = allocator_[tid]->getAllocInfo (item.getMemory ()).poolId ;
1723- return tryEvictToNextMemoryTier (tid, pid, item, fromEvictorThread );
1716+ return tryEvictToNextMemoryTier (tid, pid, item);
17241717}
17251718
17261719template <typename CacheTrait>
@@ -3047,14 +3040,14 @@ void CacheAllocator<CacheTrait>::evictForSlabRelease(
30473040template <typename CacheTrait>
30483041typename CacheAllocator<CacheTrait>::ItemHandle
30493042CacheAllocator<CacheTrait>::evictNormalItem(Item& item,
3050- bool skipIfTokenInvalid, bool fromEvictorThread ) {
3043+ bool skipIfTokenInvalid) {
30513044 XDCHECK (item.isMoving ());
30523045
30533046 if (item.isOnlyMoving ()) {
30543047 return ItemHandle{};
30553048 }
30563049
3057- auto evictHandle = tryEvictToNextMemoryTier (item, fromEvictorThread );
3050+ auto evictHandle = tryEvictToNextMemoryTier (item);
30583051 if (evictHandle) return evictHandle;
30593052
30603053 auto predicate = [](const Item& it) { return it.getRefCount () == 0 ; };
0 commit comments