mirror of
https://github.com/ceph/ceph
synced 2026-08-02 07:03:18 +00:00
os/bluestore: add fast-path allocation latency perf counter for Allocator
Fixes: https://tracker.ceph.com/issues/76936 Signed-off-by: Jaya Prakash <jayaprakash@ibm.com>
This commit is contained in:
parent
1004a24eca
commit
b883573faa
@ -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();
|
||||
|
||||
|
||||
@ -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
|
||||
};
|
||||
|
||||
|
||||
@ -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();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user