From be1c15fe8fa9e1077ded70fceb8a7bea2b6f87ee Mon Sep 17 00:00:00 2001 From: Sridhar Seshasayee Date: Mon, 7 Apr 2025 16:33:07 +0530 Subject: [PATCH] osd/scheduler/OpSchedulerItem: Fix calculation of recovery latency counters The patch fixes calculation of latency perf counters for the following objects: - PGRecovery - PGRecoveryContext and - PGRecoveryMsg Signed-off-by: Sridhar Seshasayee Fixes: https://tracker.ceph.com/issues/70811 (cherry picked from commit 9a246e4f22b470c96454d953738f359ebb8d2168) --- src/osd/scheduler/OpSchedulerItem.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/osd/scheduler/OpSchedulerItem.cc b/src/osd/scheduler/OpSchedulerItem.cc index d1abc264a8f8c..06b3cb5235dac 100644 --- a/src/osd/scheduler/OpSchedulerItem.cc +++ b/src/osd/scheduler/OpSchedulerItem.cc @@ -217,7 +217,7 @@ void PGRecovery::run( { osd->logger->tinc( l_osd_recovery_queue_lat, - time_queued - ceph_clock_now()); + ceph_clock_now() - time_queued); osd->do_recovery(pg.get(), epoch_queued, reserved_pushes, priority, handle); pg->unlock(); } @@ -230,7 +230,7 @@ void PGRecoveryContext::run( { osd->logger->tinc( l_osd_recovery_context_queue_lat, - time_queued - ceph_clock_now()); + ceph_clock_now() - time_queued); c.release()->complete(handle); pg->unlock(); } @@ -250,7 +250,7 @@ void PGRecoveryMsg::run( PGRef& pg, ThreadPool::TPHandle &handle) { - auto latency = time_queued - ceph_clock_now(); + auto latency = ceph_clock_now() - time_queued; switch (op->get_req()->get_type()) { case MSG_OSD_PG_PUSH: osd->logger->tinc(l_osd_recovery_push_queue_lat, latency); -- 2.39.5