From 32dc274a37265c0ca10bdb777c9dc57c5872fa3a Mon Sep 17 00:00:00 2001 From: Jie Yao Date: Thu, 27 Jun 2024 01:41:06 -0700 Subject: [PATCH] disable slab by default in metaservice --- conanfile.py | 2 +- src/lib/device/device.h | 1 + src/lib/device/virtual_dev.cpp | 3 ++- src/lib/device/virtual_dev.hpp | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/conanfile.py b/conanfile.py index ae350b5bd..683f93982 100644 --- a/conanfile.py +++ b/conanfile.py @@ -5,7 +5,7 @@ class HomestoreConan(ConanFile): name = "homestore" - version = "6.4.22" + version = "6.4.23" homepage = "https://github.com/eBay/Homestore" description = "HomeStore Storage Engine" topics = ("ebay", "nublox") diff --git a/src/lib/device/device.h b/src/lib/device/device.h index 8bc9c11aa..c4b91de6f 100644 --- a/src/lib/device/device.h +++ b/src/lib/device/device.h @@ -108,6 +108,7 @@ struct vdev_parameters { chunk_selector_type_t chunk_sel_type; // which chunk selector type this vdev wants to be with; vdev_multi_pdev_opts_t multi_pdev_opts; // How data to be placed on multiple vdevs sisl::blob context_data; // Context data about this vdev + bool use_slab_in_allocator{false}; // Use slab in block allocator }; class VirtualDev; diff --git a/src/lib/device/virtual_dev.cpp b/src/lib/device/virtual_dev.cpp index 79aaf0475..78be00090 100644 --- a/src/lib/device/virtual_dev.cpp +++ b/src/lib/device/virtual_dev.cpp @@ -68,7 +68,7 @@ static std::shared_ptr< BlkAllocator > create_blk_allocator(blk_allocator_type_t size, is_auto_recovery, std::string("varsize_chunk_") + std::to_string(unique_id), - is_data_drive_hdd() ? false : true /* use_slabs */}; + !is_data_drive_hdd() && m_use_slab_in_allocator /* use_slabs */}; // HS_DBG_ASSERT_EQ((size % MIN_DATA_CHUNK_SIZE(ppage_sz)), 0); return std::make_shared< VarsizeBlkAllocator >(cfg, is_init, unique_id); } @@ -91,6 +91,7 @@ VirtualDev::VirtualDev(DeviceManager& dmgr, vdev_info const& vinfo, vdev_event_c m_event_cb{std::move(event_cb)}, m_metrics{vinfo.name}, m_allocator_type{vinfo.alloc_type}, + m_use_slab_in_allocator{vinfo.use_slab_in_allocator}, m_chunk_selector_type{vinfo.chunk_sel_type}, m_auto_recovery{is_auto_recovery} { switch (m_chunk_selector_type) { diff --git a/src/lib/device/virtual_dev.hpp b/src/lib/device/virtual_dev.hpp index cba4d826e..386f0c2a8 100644 --- a/src/lib/device/virtual_dev.hpp +++ b/src/lib/device/virtual_dev.hpp @@ -98,6 +98,7 @@ class VirtualDev { std::shared_ptr< ChunkSelector > m_chunk_selector; // Instance of chunk selector blk_allocator_type_t m_allocator_type; chunk_selector_type_t m_chunk_selector_type; + bool use_slab_in_allocator; bool m_auto_recovery; public: