Skip to content

Commit c678a33

Browse files
committed
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 <[email protected]>
1 parent 4b8ca5f commit c678a33

File tree

5 files changed

+3
-46
lines changed

5 files changed

+3
-46
lines changed

src/osd/OSD.cc

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10469,28 +10469,18 @@ class MonCmdSetConfigOnFinish : public Context {
1046910469
CephContext *cct;
1047010470
std::string key;
1047110471
std::string val;
10472-
bool update_shard;
1047310472
public:
1047410473
explicit MonCmdSetConfigOnFinish(
1047510474
OSD *o,
1047610475
CephContext *cct,
1047710476
const std::string &k,
10478-
const std::string &v,
10479-
const bool s)
10480-
: osd(o), cct(cct), key(k), val(v), update_shard(s) {}
10477+
const std::string &v) : osd(o), cct(cct), key(k), val(v) {}
1048110478
void finish(int r) override {
1048210479
if (r != 0) {
1048310480
// Fallback to setting the config within the in-memory "values" map.
1048410481
cct->_conf.set_val_default(key, val);
1048510482
}
10486-
10487-
// If requested, apply this option on the
10488-
// active scheduler of each op shard.
10489-
if (update_shard) {
10490-
for (auto& shard : osd->shards) {
10491-
shard->update_scheduler_config();
10492-
}
10493-
}
10483+
cct->_conf.apply_changes(nullptr);
1049410484
}
1049510485
};
1049610486

@@ -10505,16 +10495,7 @@ void OSD::mon_cmd_set_config(const std::string &key, const std::string &val)
1050510495
"}";
1050610496
vector<std::string> vcmd{cmd};
1050710497

10508-
// List of config options to be distributed across each op shard.
10509-
// Currently limited to a couple of mClock options.
10510-
static const std::vector<std::string> shard_option =
10511-
{ "osd_mclock_max_capacity_iops_hdd", "osd_mclock_max_capacity_iops_ssd" };
10512-
const bool update_shard = std::find(shard_option.begin(),
10513-
shard_option.end(),
10514-
key) != shard_option.end();
10515-
10516-
auto on_finish = new MonCmdSetConfigOnFinish(this, cct, key,
10517-
val, update_shard);
10498+
auto on_finish = new MonCmdSetConfigOnFinish(this, cct, key, val);
1051810499
dout(10) << __func__ << " Set " << key << " = " << val << dendl;
1051910500
monc->start_mon_command(vcmd, {}, nullptr, nullptr, on_finish);
1052010501
}
@@ -11024,11 +11005,6 @@ void OSDShard::unprime_split_children(spg_t parent, unsigned old_pg_num)
1102411005
}
1102511006
}
1102611007

11027-
void OSDShard::update_scheduler_config()
11028-
{
11029-
scheduler->update_configuration();
11030-
}
11031-
1103211008
op_queue_type_t OSDShard::get_op_queue_type() const
1103311009
{
1103411010
return scheduler->get_type();

src/osd/OSD.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,6 @@ struct OSDShard {
10541054
std::set<std::pair<spg_t,epoch_t>> *merge_pgs);
10551055
void register_and_wake_split_child(PG *pg);
10561056
void unprime_split_children(spg_t parent, unsigned old_pg_num);
1057-
void update_scheduler_config();
10581057
op_queue_type_t get_op_queue_type() const;
10591058

10601059
OSDShard(

src/osd/scheduler/OpScheduler.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ class OpScheduler {
5454
// Print human readable brief description with relevant parameters
5555
virtual void print(std::ostream &out) const = 0;
5656

57-
// Apply config changes to the scheduler (if any)
58-
virtual void update_configuration() = 0;
59-
6057
// Get the scheduler type set for the queue
6158
virtual op_queue_type_t get_type() const = 0;
6259

@@ -140,10 +137,6 @@ class ClassedOpQueueScheduler final : public OpScheduler {
140137
out << ", cutoff=" << cutoff << ")";
141138
}
142139

143-
void update_configuration() final {
144-
// no-op
145-
}
146-
147140
op_queue_type_t get_type() const final {
148141
return queue.get_type();
149142
}

src/osd/scheduler/mClockScheduler.cc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,6 @@ uint32_t mClockScheduler::calc_scaled_cost(int item_cost)
4242
return mclock_conf.calc_scaled_cost(item_cost);
4343
}
4444

45-
void mClockScheduler::update_configuration()
46-
{
47-
// Apply configuration change. The expectation is that
48-
// at least one of the tracked mclock config option keys
49-
// is modified before calling this method.
50-
cct->_conf.apply_changes(nullptr);
51-
}
52-
5345
void mClockScheduler::dump(ceph::Formatter &f) const
5446
{
5547
// Display queue sizes

src/osd/scheduler/mClockScheduler.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,6 @@ class mClockScheduler : public OpScheduler {
141141
ostream << ", cutoff=" << cutoff_priority;
142142
}
143143

144-
// Update data associated with the modified mclock config key(s)
145-
void update_configuration() final;
146-
147144
// Return the scheduler type
148145
op_queue_type_t get_type() const final {
149146
return op_queue_type_t::mClockScheduler;

0 commit comments

Comments
 (0)