CacheLib icon indicating copy to clipboard operation
CacheLib copied to clipboard

NUMA bindigs support for private memory

Open vinser52 opened this issue 2 years ago • 2 comments

This PR adds NUMA binding support for private memory. I tried to align the implementation with shared memory approach and introduced PrivateMemoryManager. By current design, SlabAllocator allocates and owns private memory but shared memory is supplied as external memory to SlabAllocator. With this PR the memory is always supplied as external to SlabAllocator and probably we have to clean up SlabAllocator implementation because it is not required to own memory anymore.

vinser52 avatar Feb 20 '23 12:02 vinser52

Hi @therealgymmy, could you please take a look at this PR? It was opened more than a month ago.

vinser52 avatar Apr 04 '23 14:04 vinser52

@vinser52: apologies for the late review.

Instead of supporting this, I think we should deprecate private memory altogether. Today when a cachelib user has configued memory-monitor (where we may madvise away pages to make more memory available for the rest of the system), we will always use SHM.

This means we will just support Shm for multi-tier memory, and internally we can start moving everyone off private memory mode.

https://github.com/facebook/CacheLib/blob/main/cachelib/allocator/CacheAllocator-inl.h#L53-L54

CacheAllocator<CacheTrait>::CacheAllocator(
    typename CacheAllocator<CacheTrait>::InitMemType type, Config config)
    : isOnShm_{type != InitMemType::kNone ? true
                                          : config.memMonitoringEnabled()},

therealgymmy avatar Jun 28 '23 17:06 therealgymmy