]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/scheduler/mClockScheduler: move constructor to header
authorSamuel Just <sjust@redhat.com>
Thu, 13 Feb 2025 03:48:18 +0000 (19:48 -0800)
committerSamuel Just <sjust@redhat.com>
Tue, 18 Mar 2025 17:43:58 +0000 (17:43 +0000)
Signed-off-by: Samuel Just <sjust@redhat.com>
(cherry picked from commit 35b6176d90e1c48ba899b9ed0fd807ad8b290e0d)

src/osd/scheduler/mClockScheduler.cc
src/osd/scheduler/mClockScheduler.h

index a79c8e10758d5df0e0aba1edae67b0022e13a4ed..20df2b37d340cd5d15fbdba624f02f227be06174 100644 (file)
@@ -114,41 +114,6 @@ void mClockScheduler::_init_logger()
   logger->set(l_mclock_all_type_queue_len, 0);
 }
 
-mClockScheduler::mClockScheduler(CephContext *cct,
-  int whoami,
-  uint32_t num_shards,
-  int shard_id,
-  bool is_rotational,
-  unsigned cutoff_priority,
-  MonClient *monc,
-  bool init_perfcounter)
-  : cct(cct),
-    whoami(whoami),
-    num_shards(num_shards),
-    shard_id(shard_id),
-    is_rotational(is_rotational),
-    cutoff_priority(cutoff_priority),
-    monc(monc),
-    logger(nullptr),
-    scheduler(
-      std::bind(&mClockScheduler::ClientRegistry::get_info,
-                &client_registry,
-                _1),
-      dmc::AtLimit::Wait,
-      cct->_conf.get_val<double>("osd_mclock_scheduler_anticipation_timeout"))
-{
-  cct->_conf.add_observer(this);
-  ceph_assert(num_shards > 0);
-  set_osd_capacity_params_from_config();
-  set_config_defaults_from_profile();
-  client_registry.update_from_config(
-    cct->_conf, osd_bandwidth_capacity_per_shard);
-
-  if (init_perfcounter) {
-    _init_logger();
-  }
-}
-
 /* ClientRegistry holds the dmclock::ClientInfo configuration parameters
  * (reservation (bytes/second), weight (unitless), limit (bytes/second))
  * for each IO class in the OSD (client, background_recovery,
index bae80202f8a91d451b9331407754a35d7c484446..84170adaaeb2015a6dddf61ada602380800035b0 100644 (file)
@@ -228,9 +228,37 @@ class mClockScheduler : public OpScheduler, md_config_obs_t {
   void set_config_defaults_from_profile();
 
 public: 
-  mClockScheduler(CephContext *cct, int whoami, uint32_t num_shards,
+  mClockScheduler(
+    CephContext *cct, int whoami, uint32_t num_shards,
     int shard_id, bool is_rotational, unsigned cutoff_priority,
-    MonClient *monc, bool init_perfcounter=true);
+    MonClient *monc,
+    bool init_perfcounter=true)
+    : cct(cct),
+      whoami(whoami),
+      num_shards(num_shards),
+      shard_id(shard_id),
+      is_rotational(is_rotational),
+      cutoff_priority(cutoff_priority),
+      monc(monc),
+      logger(nullptr),
+      scheduler(
+       std::bind(&mClockScheduler::ClientRegistry::get_info,
+                 &client_registry,
+                 std::placeholders::_1),
+       crimson::dmclock::AtLimit::Wait,
+       cct->_conf.get_val<double>("osd_mclock_scheduler_anticipation_timeout"))
+  {
+    cct->_conf.add_observer(this);
+    ceph_assert(num_shards > 0);
+    set_osd_capacity_params_from_config();
+    set_config_defaults_from_profile();
+    client_registry.update_from_config(
+      cct->_conf, osd_bandwidth_capacity_per_shard);
+
+    if (init_perfcounter) {
+      _init_logger();
+    }
+  }
   ~mClockScheduler() override;
 
   /// Calculate scaled cost per item