From: Igor Fedotov Date: Fri, 28 Feb 2025 07:54:57 +0000 (+0300) Subject: os/bluestore: show allocator types in metadata dump X-Git-Tag: v19.2.3~166^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b16e796d71e2b6023dfe8829c2ec7012dc969ac6;p=ceph.git os/bluestore: show allocator types in metadata dump Signed-off-by: Igor Fedotov (cherry picked from commit 1aae3b66fa55f893f7ec002854bb699541635d53) --- diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index 16f62c663b9..e22f5df40cc 100644 --- a/src/os/bluestore/BlueFS.cc +++ b/src/os/bluestore/BlueFS.cc @@ -775,14 +775,16 @@ void BlueFS::_init_alloc() name += devnames[id]; else name += to_string(uintptr_t(this)); + string alloc_type = cct->_conf->bluefs_allocator; + dout(1) << __func__ << " new, id " << id << std::hex << ", allocator name " << name - << ", allocator type " << cct->_conf->bluefs_allocator + << ", allocator type " << alloc_type << ", capacity 0x" << bdev[id]->get_size() << ", reserved 0x" << block_reserved[id] << ", block size 0x" << alloc_size[id] << std::dec << dendl; - alloc[id] = Allocator::create(cct, cct->_conf->bluefs_allocator, + alloc[id] = Allocator::create(cct, alloc_type, bdev[id]->get_size(), alloc_size[id], name); @@ -1120,10 +1122,14 @@ int BlueFS::prepare_new_device(int id, const bluefs_layout_t& layout) void BlueFS::collect_metadata(map *pm, unsigned skip_bdev_id) { - if (skip_bdev_id != BDEV_DB && bdev[BDEV_DB]) + if (skip_bdev_id != BDEV_DB && bdev[BDEV_DB]) { bdev[BDEV_DB]->collect_metadata("bluefs_db_", pm); - if (bdev[BDEV_WAL]) + (*pm)["bluefs_db_allocator"]= alloc[BDEV_DB] ? alloc[BDEV_DB]->get_type(): "null"; + } + if (bdev[BDEV_WAL]) { bdev[BDEV_WAL]->collect_metadata("bluefs_wal_", pm); + (*pm)["bluefs_wal_allocator"]= alloc[BDEV_WAL] ? alloc[BDEV_WAL]->get_type(): "null"; + } } void BlueFS::get_devices(set *ls) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index a4912332979..7601966c3ff 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -11865,6 +11865,7 @@ void BlueStore::collect_metadata(map *pm) } (*pm)["bluestore_min_alloc_size"] = stringify(min_alloc_size); (*pm)["bluestore_allocation_from_file"] = stringify(fm && fm->is_null_manager()); + (*pm)["bluestore_allocator"] = alloc ? alloc->get_type() : "null"; } int BlueStore::get_numa_node( diff --git a/src/os/bluestore/bluefs_types.h b/src/os/bluestore/bluefs_types.h index 2323e5ed6a3..99ce1c3c146 100644 --- a/src/os/bluestore/bluefs_types.h +++ b/src/os/bluestore/bluefs_types.h @@ -213,7 +213,7 @@ WRITE_CLASS_ENCODER(bluefs_layout_t) struct bluefs_super_t { uuid_d uuid; ///< unique to this bluefs instance uuid_d osd_uuid; ///< matches the osd that owns us - uint64_t version; + uint64_t version; ///< In fact that's update counter uint32_t block_size; bluefs_fnode_t log_fnode;