Skip to content

Commit

Permalink
Edit Hybrid_Cache.md using inpage editor
Browse files Browse the repository at this point in the history
Summary:
This diff has been automatically generated by the inpage editor.

NOTE: If you want to update this diff, go via the preview link inside the static docs section below.
Ensure you are editing the same page that was used to create this diff.

Reviewed By: haowu14

Differential Revision: D53291622

fbshipit-source-id: 244995b225bcb9860f011156a08e43fd895e6b77
  • Loading branch information
Jiayue Bao authored and facebook-github-bot committed Feb 1, 2024
1 parent 0763d29 commit f8dfc24
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ CacheLib supports use of multiple HW mediums through [hybrid cache](/docs/Cache_
Currently we support SSDs as the NVM medium for Hybrid Cache. Navy is our SSD optimized cache engine. To interface with Navy, CacheAllocator uses the `NvmCache` wrapper. CacheAllocator delegates the responsibility of performing thread safe lookups, inserts and deletes for Navy to `NvmCache`. `NvmCache` implements the functionality that handles transitions of Item to and from NVM. Since there is no global key level lock in CacheAllocator to synchronize operations that change Item's state between DRAM and NVM, `NvmCache` employs optimistic concurrency control primitives to enforce data correctness.

### Item allocation and eviction
CacheAllocator allocates the Item in DRAM when `allocate` is called. Once the Item becomes a victim for eviction in the MMContainer, CacheAllocator evicts the Item to `NvmCache`. Since NVM has constraints on write endurance, CacheAllocator supports a pluggabble eviction policy that can reject Items when needed or suitable. Items read from NVM are also inserted into DRAM. When these Items get evicted, CacheAllocator can choose to not write them into NVM since it is already present by inferring if `it->isNvmClean()`.
CacheAllocator allocates the Item in DRAM when `allocate` is called. Once the Item becomes a victim for eviction in the MMContainer, CacheAllocator evicts the Item to `NvmCache`. Since NVM has constraints on write endurance, CacheAllocator supports a pluggable admission policy that can reject Items when needed or suitable. Items read from NVM are also inserted into DRAM. When these Items get evicted, CacheAllocator can choose to not write them into NVM since it is already present by inferring if `it->isNvmClean()`.
![](Hybrid_Cache_allocate.png "allocate with hybrid cache ")

### Item lookups
Expand Down

0 comments on commit f8dfc24

Please sign in to comment.