From: Samuel Just Date: Fri, 8 Aug 2025 18:11:33 +0000 (-0700) Subject: osd/scheduler: drop OpScheduler::update_configuration X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c678a337314b4ef3c0edc39fb24de6d1c82bd5e6;p=ceph.git osd/scheduler: drop OpScheduler::update_configuration This simply calls cct->_conf.apply_changes(nullptr); in MonCmdSetConfigOnFinish. Much simpler to just call it there directly. Signed-off-by: Samuel Just --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 2bf224e829c..081658edd6e 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -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 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 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(); diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 6dfee8390cc..83a3972a5f9 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -1054,7 +1054,6 @@ struct OSDShard { std::set> *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( diff --git a/src/osd/scheduler/OpScheduler.h b/src/osd/scheduler/OpScheduler.h index cb6ff69f2fe..35955c42044 100644 --- a/src/osd/scheduler/OpScheduler.h +++ b/src/osd/scheduler/OpScheduler.h @@ -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(); } diff --git a/src/osd/scheduler/mClockScheduler.cc b/src/osd/scheduler/mClockScheduler.cc index f343aa923ea..cdb121095e6 100644 --- a/src/osd/scheduler/mClockScheduler.cc +++ b/src/osd/scheduler/mClockScheduler.cc @@ -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 diff --git a/src/osd/scheduler/mClockScheduler.h b/src/osd/scheduler/mClockScheduler.h index 0adf106925a..4442ad40b7c 100644 --- a/src/osd/scheduler/mClockScheduler.h +++ b/src/osd/scheduler/mClockScheduler.h @@ -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;