Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/include/mempool.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ namespace mempool {
f(bluestore_cache_onode) \
f(bluestore_cache_meta) \
f(bluestore_cache_other) \
f(bluestore_Buffer) \
f(bluestore_Extent) \
f(bluestore_Blob) \
f(bluestore_SharedBlob) \
f(bluestore_cache_buffer) \
f(bluestore_extent) \
f(bluestore_blob) \
f(bluestore_shared_blob) \
f(bluestore_inline_bl) \
f(bluestore_fsck) \
f(bluestore_txc) \
Expand Down
9 changes: 4 additions & 5 deletions src/os/bluestore/BlueStore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,14 @@ using bid_t = decltype(BlueStore::Blob::id);
MEMPOOL_DEFINE_OBJECT_FACTORY(BlueStore::Onode, bluestore_onode,
bluestore_cache_onode);

// bluestore_cache_other
MEMPOOL_DEFINE_OBJECT_FACTORY(BlueStore::Buffer, bluestore_buffer,
bluestore_Buffer);
bluestore_cache_buffer);
MEMPOOL_DEFINE_OBJECT_FACTORY(BlueStore::Extent, bluestore_extent,
bluestore_Extent);
bluestore_extent);
MEMPOOL_DEFINE_OBJECT_FACTORY(BlueStore::Blob, bluestore_blob,
bluestore_Blob);
bluestore_blob);
MEMPOOL_DEFINE_OBJECT_FACTORY(BlueStore::SharedBlob, bluestore_shared_blob,
bluestore_SharedBlob);
bluestore_shared_blob);

// bluestore_txc
MEMPOOL_DEFINE_OBJECT_FACTORY(BlueStore::TransContext, bluestore_transcontext,
Expand Down
12 changes: 6 additions & 6 deletions src/os/bluestore/BlueStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -2164,8 +2164,8 @@ class BlueStore : public ObjectStore,
bool collections_had_errors = false;
std::map<coll_t,CollectionRef> new_coll_map;

std::vector<OnodeCacheShard*> onode_cache_shards;
std::vector<BufferCacheShard*> buffer_cache_shards;
mempool::bluestore_cache_buffer::vector<BufferCacheShard*> buffer_cache_shards;
mempool::bluestore_cache_onode::vector<OnodeCacheShard*> onode_cache_shards;

/// protect zombie_osr_set
ceph::mutex zombie_osr_lock = ceph::make_mutex("BlueStore::zombie_osr_lock");
Expand Down Expand Up @@ -2440,13 +2440,13 @@ class BlueStore : public ObjectStore,
}
}
virtual uint64_t _get_used_bytes() const {
return mempool::bluestore_Buffer::allocated_bytes() +
mempool::bluestore_Blob::allocated_bytes() +
mempool::bluestore_Extent::allocated_bytes() +
return mempool::bluestore_blob::allocated_bytes() +
mempool::bluestore_extent::allocated_bytes() +
mempool::bluestore_cache_buffer::allocated_bytes() +
mempool::bluestore_cache_meta::allocated_bytes() +
mempool::bluestore_cache_other::allocated_bytes() +
mempool::bluestore_cache_onode::allocated_bytes() +
mempool::bluestore_SharedBlob::allocated_bytes() +
mempool::bluestore_shared_blob::allocated_bytes() +
mempool::bluestore_inline_bl::allocated_bytes();
}
virtual void shift_bins() {
Expand Down
2 changes: 1 addition & 1 deletion src/os/bluestore/bluestore_types.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ 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);
bluestore_shared_blob);

void bluestore_shared_blob_t::dump(Formatter *f) const
{
Expand Down
1 change: 0 additions & 1 deletion src/os/bluestore/bluestore_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include "common/hobject.h"
#include "compressor/Compressor.h"
#include "common/Checksummer.h"
#include "include/mempool.h"
#include "include/ceph_hash.h"

namespace ceph {
Expand Down
14 changes: 9 additions & 5 deletions src/test/objectstore/store_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7002,10 +7002,14 @@ TEST_P(StoreTestSpecificAUSize, OnodeSizeTracking) {
coll_t cid;
ghobject_t hoid(hobject_t("test_hint", "", CEPH_NOSNAP, 0, -1, ""));
size_t obj_size = 4 * 1024 * 1024;
uint64_t total_bytes_prev;
uint64_t total_bytes, total_bytes2;
uint64_t total_onodes;
get_mempool_stats(&total_bytes, &total_onodes);
ASSERT_EQ(total_onodes, 0u);
total_bytes_prev = total_bytes;
// 5u for onode_cache_shards vector
ASSERT_EQ(total_onodes, 5u);
ASSERT_EQ(total_bytes, 40u);

auto ch = store->create_new_collection(cid);
{
Expand All @@ -7024,8 +7028,8 @@ TEST_P(StoreTestSpecificAUSize, OnodeSizeTracking) {
ASSERT_EQ(r, 0);
}
get_mempool_stats(&total_bytes, &total_onodes);
ASSERT_NE(total_bytes, 0u);
ASSERT_EQ(total_onodes, 1u);
ASSERT_GT(total_bytes - total_bytes_prev, 0u);
ASSERT_EQ(total_onodes, 6u);

{
ObjectStore::Transaction t;
Expand All @@ -7045,7 +7049,7 @@ TEST_P(StoreTestSpecificAUSize, OnodeSizeTracking) {
}
get_mempool_stats(&total_bytes2, &total_onodes);
ASSERT_NE(total_bytes2, 0u);
ASSERT_EQ(total_onodes, 1u);
ASSERT_EQ(total_onodes, 6u);
}
{
cout <<" mempool dump:\n";
Expand All @@ -7064,7 +7068,7 @@ TEST_P(StoreTestSpecificAUSize, OnodeSizeTracking) {
}
get_mempool_stats(&total_bytes, &total_onodes);
ASSERT_NE(total_bytes, 0u);
ASSERT_EQ(total_onodes, 1u);
ASSERT_EQ(total_onodes, 6u);

{
cout <<" mempool dump:\n";
Expand Down