]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd/rwl: track syncpoint's logentry number and write bytes 35026/head
authorChangcheng Liu <changcheng.liu@aliyun.com>
Tue, 12 May 2020 09:47:47 +0000 (17:47 +0800)
committerChangcheng Liu <changcheng.liu@aliyun.com>
Wed, 20 May 2020 13:55:56 +0000 (21:55 +0800)
The SyncPoint's logentry number and write bytes affect the
peformance of rwl cache a lot. It needs to be tracked by
perf couter for analysis.

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
src/librbd/cache/ReplicatedWriteLog.cc
src/librbd/cache/rwl/SyncPoint.cc
src/librbd/cache/rwl/Types.h

index 434cdb511198d12eab68e992f099bd97c96451df..16e67974f3d5ec040948da2f41f7808a7caf0929 100644 (file)
@@ -99,6 +99,24 @@ void ReplicatedWriteLog<I>::perf_start(std::string name) {
     16,                              ///< Ranges into the mS
   };
 
+  // Syncpoint logentry number x-axis configuration for op histograms
+  PerfHistogramCommon::axis_config_d sp_logentry_number_config{
+    "logentry number",
+    PerfHistogramCommon::SCALE_LINEAR, // log entry number in linear scale
+    0,                                 // Start at 0
+    1,                                 // Quantization unit is 1
+    260,                               // Up to 260 > (MAX_WRITES_PER_SYNC_POINT)
+  };
+
+  // Syncpoint bytes number y-axis configuration for op histogram
+  PerfHistogramCommon::axis_config_d sp_bytes_number_config{
+    "Number of SyncPoint",
+    PerfHistogramCommon::SCALE_LOG2,   // Request size in logarithmic scale
+    0,                                 // Start at 0
+    512,                               // Quantization unit is 512
+    17,                                // Writes up to 8M >= MAX_BYTES_PER_SYNC_POINT
+  };
+
   // Op size axis configuration for op histogram y axis, values are in bytes
   PerfHistogramCommon::axis_config_d op_hist_y_axis_config{
     "Request size (bytes)",
@@ -127,6 +145,11 @@ void ReplicatedWriteLog<I>::perf_start(std::string name) {
 
   plb.add_u64_counter(l_librbd_rwl_rd_part_hit_req, "part_hit_rd", "reads partially hitting RWL");
 
+  plb.add_u64_counter_histogram(
+    l_librbd_rwl_syncpoint_hist, "syncpoint_logentry_bytes_histogram",
+    sp_logentry_number_config, sp_bytes_number_config,
+    "Histogram of syncpoint's logentry numbers vs bytes number");
+
   plb.add_u64_counter(l_librbd_rwl_wr_req, "wr", "Writes");
   plb.add_u64_counter(l_librbd_rwl_wr_req_def, "wr_def", "Writes deferred for resources");
   plb.add_u64_counter(l_librbd_rwl_wr_req_def_lanes, "wr_def_lanes", "Writes deferred for lanes");
index cb3f3cfeebd917de9e7c4a05125a6cd9f90bd7af..19126acd664423ee7256f654cdc4f40b8cf71c25 100644 (file)
@@ -93,6 +93,8 @@ void SyncPoint::add_in_on_appending_ctxs(Context* ctx) {
 
 void SyncPoint::setup_earlier_sync_point(std::shared_ptr<SyncPoint> sync_point,
                                          uint64_t last_op_sequence_num) {
+    m_perfcounter->inc(l_librbd_rwl_syncpoint_hist,
+                       sync_point->log_entry->writes, sync_point->log_entry->bytes);
     earlier_sync_point = sync_point;
     log_entry->prior_sync_point_flushed = false;
     earlier_sync_point->log_entry->next_sync_point_entry = log_entry;
index a5f3dc2ec183926603cb4474ff6a47ce3c7e38b8..4fb40433faa303409bc5c525424da9c0efc94d59 100644 (file)
@@ -27,6 +27,9 @@ enum {
   // Reed requests with hit and miss extents
   l_librbd_rwl_rd_part_hit_req,  // read ops
 
+  // Per SyncPoint's LogEntry number and write bytes distribution
+  l_librbd_rwl_syncpoint_hist,
+
   // All write requests
   l_librbd_rwl_wr_req,             // write requests
   l_librbd_rwl_wr_req_def,         // write requests deferred for resources