@@ -27,7 +27,7 @@ namespace tests {
2727template <typename AllocatorT>
2828class AllocatorMemoryTiersTest : public AllocatorTest <AllocatorT> {
2929 public:
30- void testMultiTiersInvalid () {
30+ void testMultiTiersFormFileInvalid () {
3131 typename AllocatorT::Config config;
3232 config.setCacheSize (100 * Slab::kSize );
3333 config.configureMemoryTiers ({
@@ -42,7 +42,7 @@ class AllocatorMemoryTiersTest : public AllocatorTest<AllocatorT> {
4242 std::invalid_argument);
4343 }
4444
45- void testMultiTiersValid () {
45+ void testMultiTiersFromFileValid () {
4646 typename AllocatorT::Config config;
4747 config.setCacheSize (100 * Slab::kSize );
4848 config.enableCachePersistence (" /tmp" );
@@ -83,6 +83,47 @@ class AllocatorMemoryTiersTest : public AllocatorTest<AllocatorT> {
8383 ASSERT (handle != nullptr );
8484 ASSERT_NO_THROW (alloc->insertOrReplace (handle));
8585 }
86+
87+ void testMultiTiersNumaBindingsSysVValid () {
88+ typename AllocatorT::Config config;
89+ config.setCacheSize (100 * Slab::kSize );
90+ config.enableCachePersistence (" /tmp" );
91+ config.configureMemoryTiers ({
92+ MemoryTierCacheConfig::fromShm ()
93+ .setRatio (1 ).setMemBind ({0 }),
94+ MemoryTierCacheConfig::fromShm ()
95+ .setRatio (1 ).setMemBind ({0 })
96+ });
97+
98+ auto alloc = std::make_unique<AllocatorT>(AllocatorT::SharedMemNew, config);
99+ ASSERT (alloc != nullptr );
100+
101+ auto pool = alloc->addPool (" default" , alloc->getCacheMemoryStats ().cacheSize );
102+ auto handle = alloc->allocate (pool, " key" , std::string (" value" ).size ());
103+ ASSERT (handle != nullptr );
104+ ASSERT_NO_THROW (alloc->insertOrReplace (handle));
105+ }
106+
107+ void testMultiTiersNumaBindingsPosixValid () {
108+ typename AllocatorT::Config config;
109+ config.setCacheSize (100 * Slab::kSize );
110+ config.enableCachePersistence (" /tmp" );
111+ config.usePosixForShm ();
112+ config.configureMemoryTiers ({
113+ MemoryTierCacheConfig::fromShm ()
114+ .setRatio (1 ).setMemBind ({0 }),
115+ MemoryTierCacheConfig::fromShm ()
116+ .setRatio (1 ).setMemBind ({0 })
117+ });
118+
119+ auto alloc = std::make_unique<AllocatorT>(AllocatorT::SharedMemNew, config);
120+ ASSERT (alloc != nullptr );
121+
122+ auto pool = alloc->addPool (" default" , alloc->getCacheMemoryStats ().cacheSize );
123+ auto handle = alloc->allocate (pool, " key" , std::string (" value" ).size ());
124+ ASSERT (handle != nullptr );
125+ ASSERT_NO_THROW (alloc->insertOrReplace (handle));
126+ }
86127};
87128} // namespace tests
88129} // namespace cachelib
0 commit comments