]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/scheduler: drop OpScheduler::update_configuration
authorSamuel Just <sjust@redhat.com>
Fri, 8 Aug 2025 18:11:33 +0000 (11:11 -0700)
committerSamuel Just <sjust@redhat.com>
Tue, 2 Sep 2025 16:18:03 +0000 (16:18 +0000)
This simply calls cct->_conf.apply_changes(nullptr); in
MonCmdSetConfigOnFinish.  Much simpler to just call it there
directly.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/OSD.cc
src/osd/OSD.h
src/osd/scheduler/OpScheduler.h
src/osd/scheduler/mClockScheduler.cc
src/osd/scheduler/mClockScheduler.h

index 2bf224e829c172e3b0fa76e5e096041de30946c1..081658edd6e0eee7584ed1911f815b19515d8ead 100644 (file)
@@ -10469,28 +10469,18 @@ class MonCmdSetConfigOnFinish : public Context {
   CephContext *cct;
   std::string key;
   std::string val;
-  bool update_shard;
 public:
   explicit MonCmdSetConfigOnFinish(
     OSD *o,
     CephContext *cct,
     const std::string &k,
-    const std::string &v,
-    const bool s)
-      : osd(o), cct(cct), key(k), val(v), update_shard(s) {}
+    const std::string &v) : osd(o), cct(cct), key(k), val(v) {}
   void finish(int r) override {
     if (r != 0) {
       // Fallback to setting the config within the in-memory "values" map.
       cct->_conf.set_val_default(key, val);
     }
-
-    // If requested, apply this option on the
-    // active scheduler of each op shard.
-    if (update_shard) {
-      for (auto& shard : osd->shards) {
-        shard->update_scheduler_config();
-      }
-    }
+    cct->_conf.apply_changes(nullptr);
   }
 };
 
@@ -10505,16 +10495,7 @@ void OSD::mon_cmd_set_config(const std::string &key, const std::string &val)
     "}";
   vector<std::string> vcmd{cmd};
 
-  // List of config options to be distributed across each op shard.
-  // Currently limited to a couple of mClock options.
-  static const std::vector<std::string> shard_option =
-    { "osd_mclock_max_capacity_iops_hdd", "osd_mclock_max_capacity_iops_ssd" };
-  const bool update_shard = std::find(shard_option.begin(),
-                                      shard_option.end(),
-                                      key) != shard_option.end();
-
-  auto on_finish = new MonCmdSetConfigOnFinish(this, cct, key,
-                                               val, update_shard);
+  auto on_finish = new MonCmdSetConfigOnFinish(this, cct, key, val);
   dout(10) << __func__ << " Set " << key << " = " << val << dendl;
   monc->start_mon_command(vcmd, {}, nullptr, nullptr, on_finish);
 }
@@ -11024,11 +11005,6 @@ void OSDShard::unprime_split_children(spg_t parent, unsigned old_pg_num)
   }
 }
 
-void OSDShard::update_scheduler_config()
-{
-  scheduler->update_configuration();
-}
-
 op_queue_type_t OSDShard::get_op_queue_type() const
 {
   return scheduler->get_type();
index 6dfee8390cc8d5c8e6d248045086148ee7bf9240..83a3972a5f998923fca683c2b1a62b358d549e92 100644 (file)
@@ -1054,7 +1054,6 @@ struct OSDShard {
                    std::set<std::pair<spg_t,epoch_t>> *merge_pgs);
   void register_and_wake_split_child(PG *pg);
   void unprime_split_children(spg_t parent, unsigned old_pg_num);
-  void update_scheduler_config();
   op_queue_type_t get_op_queue_type() const;
 
   OSDShard(
index cb6ff69f2fea5a382c6ef980029cf1a24f577ab3..35955c42044ab667529e8b7012174d17d76471ee 100644 (file)
@@ -54,9 +54,6 @@ public:
   // Print human readable brief description with relevant parameters
   virtual void print(std::ostream &out) const = 0;
 
-  // Apply config changes to the scheduler (if any)
-  virtual void update_configuration() = 0;
-
   // Get the scheduler type set for the queue
   virtual op_queue_type_t get_type() const = 0;
 
@@ -140,10 +137,6 @@ public:
     out << ", cutoff=" << cutoff << ")";
   }
 
-  void update_configuration() final {
-    // no-op
-  }
-
   op_queue_type_t get_type() const final {
     return queue.get_type();
   }
index f343aa923eaf68fa08c1d49c2af2a64973852c51..cdb121095e6101bb6435ec2157da0044302f40ea 100644 (file)
@@ -42,14 +42,6 @@ uint32_t mClockScheduler::calc_scaled_cost(int item_cost)
   return mclock_conf.calc_scaled_cost(item_cost);
 }
 
-void mClockScheduler::update_configuration()
-{
-  // Apply configuration change. The expectation is that
-  // at least one of the tracked mclock config option keys
-  // is modified before calling this method.
-  cct->_conf.apply_changes(nullptr);
-}
-
 void mClockScheduler::dump(ceph::Formatter &f) const
 {
   // Display queue sizes
index 0adf106925aa84f5e67ee3a4f7599842d08c70cb..4442ad40b7c478536c6300bcd3a53371725f0ab6 100644 (file)
@@ -141,9 +141,6 @@ public:
     ostream << ", cutoff=" << cutoff_priority;
   }
 
-  // Update data associated with the modified mclock config key(s)
-  void update_configuration() final;
-
   // Return the scheduler type
   op_queue_type_t get_type() const final {
     return op_queue_type_t::mClockScheduler;