From: Igor Fedotov Date: Sun, 20 Sep 2020 09:22:05 +0000 (+0300) Subject: os/bluestore: add missing structs to bluestore_cache_other mempool X-Git-Tag: v14.2.17~114^2^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7b44d545a3ed77fcf99ab4211cde08fd0771acd8;p=ceph.git os/bluestore: add missing structs to bluestore_cache_other mempool Fixes: https://tracker.ceph.com/issues/47551 Signed-off-by: Igor Fedotov (cherry picked from commit 4592c5df554190065fa9a994f7b6dc3fed7ea214) --- diff --git a/src/os/bluestore/bluestore_types.cc b/src/os/bluestore/bluestore_types.cc index 4d7e14afd863..134eed5b89ca 100644 --- a/src/os/bluestore/bluestore_types.cc +++ b/src/os/bluestore/bluestore_types.cc @@ -358,6 +358,10 @@ void bluestore_blob_use_tracker_t::allocate() { ceph_assert(num_au != 0); bytes_per_au = new uint32_t[num_au]; + mempool::get_pool( + mempool::pool_index_t(mempool::mempool_bluestore_cache_other)). + adjust_count(1, sizeof(uint32_t) * num_au); + for (uint32_t i = 0; i < num_au; ++i) { bytes_per_au[i] = 0; } @@ -1000,6 +1004,8 @@ void bluestore_blob_t::split(uint32_t blob_offset, bluestore_blob_t& rb) } // bluestore_shared_blob_t +MEMPOOL_DEFINE_OBJECT_FACTORY(bluestore_shared_blob_t, bluestore_shared_blob_t, + bluestore_cache_other); void bluestore_shared_blob_t::dump(Formatter *f) const { diff --git a/src/os/bluestore/bluestore_types.h b/src/os/bluestore/bluestore_types.h index dc6b25f0b8ee..d7c437b816a6 100644 --- a/src/os/bluestore/bluestore_types.h +++ b/src/os/bluestore/bluestore_types.h @@ -264,6 +264,9 @@ struct bluestore_blob_use_tracker_t { void clear() { if (num_au != 0) { delete[] bytes_per_au; + mempool::get_pool( + mempool::pool_index_t(mempool::mempool_bluestore_cache_other)). + adjust_count(-1, -sizeof(uint32_t) * num_au); } bytes_per_au = 0; au_size = 0; @@ -864,6 +867,7 @@ ostream& operator<<(ostream& out, const bluestore_blob_t& o); /// shared blob state struct bluestore_shared_blob_t { + MEMPOOL_CLASS_HELPERS(); uint64_t sbid; ///> shared blob id bluestore_extent_ref_map_t ref_map; ///< shared blob extents