]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: add fast-path allocation latency perf counter for Allocator 69540/head
authorJaya Prakash <jayaprakash@ibm.com>
Wed, 1 Jul 2026 13:22:48 +0000 (13:22 +0000)
committerJaya Prakash <jayaprakash@ibm.com>
Wed, 1 Jul 2026 13:29:37 +0000 (13:29 +0000)
Fixes: https://tracker.ceph.com/issues/76936
Signed-off-by: Jaya Prakash <jayaprakash@ibm.com>
src/os/bluestore/AllocatorBase.cc
src/os/bluestore/AllocatorBase.h
src/os/bluestore/Btree2Allocator.cc

index a7c068dcfebe007f577736e522640e7302d56141..3f0a78bfceb446047efd67ecb6666b2593c60194 100644 (file)
@@ -215,7 +215,7 @@ void AllocatorPerf::_init_logger(std::string_view name) {
 
   b.add_time_avg(l_bluestore_allocator_alloc_process_lat,
     "alloc_process_lat",
-    "Allocator processing latency",
+    "Allocator processing latency while holding lock",
     "apl",
     PerfCountersBuilder::PRIO_USEFUL);
   b.add_time_avg(l_bluestore_allocator_lock_wait_lat,
@@ -223,6 +223,11 @@ void AllocatorPerf::_init_logger(std::string_view name) {
     "Allocator lock wait latency",
     "lwl",
     PerfCountersBuilder::PRIO_USEFUL);
+  b.add_time_avg(l_bluestore_allocator_nolock_process_lat,
+    "nolock_process_lat",
+    "Allocator lockless fast-path allocation latency",
+    "fpl",
+    PerfCountersBuilder::PRIO_USEFUL);
 
   logger = b.create_perf_counters();
 
index dc567c3c2c9a60ea5941714413dbce6db926a870..3db3546600733de26febc39f161835854e7f20a7 100644 (file)
@@ -26,6 +26,7 @@ enum {
   l_bluestore_allocator_first = 732300,
   l_bluestore_allocator_alloc_process_lat,
   l_bluestore_allocator_lock_wait_lat,
+  l_bluestore_allocator_nolock_process_lat,
   l_bluestore_allocator_last
 };
 
index 7531f059852d4ede065078f3a70e4206f1ea0af0..d01839d3518136a9806323d4d864634bd34e23b6 100644 (file)
@@ -86,9 +86,13 @@ int64_t Btree2Allocator::allocate(
     max_alloc_size = p2align(uint64_t(cap), (uint64_t)block_size);
   }
   uint64_t cached_chunk_offs = 0;
+  auto fast_alloc_start = mono_clock::now();
   if (cache && cache->try_get(&cached_chunk_offs, want)) {
     num_free -= want;
     extents->emplace_back(cached_chunk_offs, want);
+    logger->tinc_with_max(
+        l_bluestore_allocator_nolock_process_lat,
+        mono_clock::now() - fast_alloc_start);
     return want;
   }
   auto lock_wait_start = mono_clock::now();