From 55198cfa05bb033e2de5da120b2ccf922318ea3e Mon Sep 17 00:00:00 2001 From: Adam Kupczyk Date: Thu, 6 Feb 2025 12:37:21 +0000 Subject: [PATCH] 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 --- src/os/bluestore/Allocator.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/os/bluestore/Allocator.cc b/src/os/bluestore/Allocator.cc index f6a3654ab3c0d..603f698e382aa 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; } -- 2.47.3