]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/scheduler/mClockScheduler: add constructor to specify idle/erase/check times
authorSamuel Just <sjust@redhat.com>
Thu, 13 Feb 2025 03:45:42 +0000 (19:45 -0800)
committerSamuel Just <sjust@redhat.com>
Tue, 18 Mar 2025 17:43:58 +0000 (17:43 +0000)
Useful for unit test, default times are *really* long.

Signed-off-by: Samuel Just <sjust@redhat.com>
(cherry picked from commit 8b7b0463792d85575996e65752087a25c9a3a65a)

src/osd/scheduler/mClockScheduler.h

index 84170adaaeb2015a6dddf61ada602380800035b0..7ef2c05a693a91d6ceb3d6c7cbdf7c77bee7fc69 100644 (file)
@@ -228,9 +228,13 @@ class mClockScheduler : public OpScheduler, md_config_obs_t {
   void set_config_defaults_from_profile();
 
 public: 
+  template<typename Rep, typename Per>
   mClockScheduler(
     CephContext *cct, int whoami, uint32_t num_shards,
     int shard_id, bool is_rotational, unsigned cutoff_priority,
+    std::chrono::duration<Rep,Per> idle_age,
+    std::chrono::duration<Rep,Per> erase_age,
+    std::chrono::duration<Rep,Per> check_time,
     MonClient *monc,
     bool init_perfcounter=true)
     : cct(cct),
@@ -245,6 +249,7 @@ public:
        std::bind(&mClockScheduler::ClientRegistry::get_info,
                  &client_registry,
                  std::placeholders::_1),
+       idle_age, erase_age, check_time,
        crimson::dmclock::AtLimit::Wait,
        cct->_conf.get_val<double>("osd_mclock_scheduler_anticipation_timeout"))
   {
@@ -259,6 +264,17 @@ public:
       _init_logger();
     }
   }
+  mClockScheduler(
+    CephContext *cct, int whoami, uint32_t num_shards,
+    int shard_id, bool is_rotational, unsigned cutoff_priority,
+    MonClient *monc,
+    bool init_perfcounter=true) :
+    mClockScheduler(
+      cct, whoami, num_shards, shard_id, is_rotational, cutoff_priority,
+      crimson::dmclock::standard_idle_age,
+      crimson::dmclock::standard_erase_age,
+      crimson::dmclock::standard_check_time,
+      monc, init_perfcounter) {}
   ~mClockScheduler() override;
 
   /// Calculate scaled cost per item