From: Adam Kupczyk Date: Thu, 6 Feb 2025 12:37:21 +0000 (+0000) Subject: os/bluestore: Fix default base size for histogram X-Git-Tag: v20.0.0~78^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F61679%2Fhead;p=ceph.git os/bluestore: Fix default base size for histogram Use allocator's unit size instead of 4096 as default value. This makes "bluefs-db" and "bluefs-wal" histograms work on defaults. + Fixed error printout Fixes: https://tracker.ceph.com/issues/69855 Signed-off-by: Adam Kupczyk --- diff --git a/src/os/bluestore/Allocator.cc b/src/os/bluestore/Allocator.cc index f6a3654ab3c..603f698e382 100644 --- a/src/os/bluestore/Allocator.cc +++ b/src/os/bluestore/Allocator.cc @@ -108,20 +108,20 @@ public: f->dump_float("fragmentation_rating", alloc->get_fragmentation()); f->close_section(); } else if (command == "bluestore allocator fragmentation histogram " + name) { - int64_t alloc_unit = 4096; + int64_t alloc_unit = alloc->get_block_size(); cmd_getval(cmdmap, "alloc_unit", alloc_unit); if (alloc_unit <= 0 || p2align(alloc_unit, alloc->get_block_size()) != alloc_unit) { ss << "Invalid allocation unit: '" << alloc_unit - << ", to be aligned with: '" << alloc->get_block_size() - << std::endl; + << "', to be aligned with: '" << alloc->get_block_size() + << "'" << std::endl; return -EINVAL; } int64_t num_buckets = 8; cmd_getval(cmdmap, "num_buckets", num_buckets); if (num_buckets < 2) { ss << "Invalid amount of buckets (min=2): '" << num_buckets - << std::endl; + << "'" << std::endl; return -EINVAL; }