-
Hello, I'm part of a group of university students who are trying to modify how Cachelib allocates memory. Specifically, we are trying to make the DRAM cache be able to use memory that is mapped to devices (i.e using Could we be pointed to some exact locations where Cachelib interfaces with the OS to get memory? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 15 replies
-
Hi @2matttu, thanks for reaching out. Here is where the memory is allocated and then passed into SlabAllocator: https://github.com/facebook/CacheLib/blob/main/cachelib/allocator/CacheAllocator-inl.h#L147-L158 The memory is managed by ShmManager class, here is how it asks OS for the memory internally: |
Beta Was this translation helpful? Give feedback.
-
@2matttu: can you elaborate why you would like to modify DRAM cache to use memory mapped to a device. (What sort of device is this?) If you're looking for something that works across DRAM + Flash devices, we have a HybridCache setup for that. https://cachelib.org/docs/Cache_Library_User_Guides/HybridCache |
Beta Was this translation helpful? Give feedback.
Hi @2matttu, thanks for reaching out.
Here is where the memory is allocated and then passed into SlabAllocator: https://github.com/facebook/CacheLib/blob/main/cachelib/allocator/CacheAllocator-inl.h#L147-L158
The memory is managed by ShmManager class, here is how it asks OS for the memory internally:
https://github.com/facebook/CacheLib/blob/main/cachelib/shm/PosixShmSegment.cpp
https://github.com/facebook/CacheLib/blob/main/cachelib/shm/SysVShmSegment.cpp