]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Handle configuration changes to mclock config options
authorSridhar Seshasayee <sseshasa@redhat.com>
Tue, 12 Jan 2021 11:32:37 +0000 (17:02 +0530)
committerSridhar Seshasayee <sseshasa@redhat.com>
Sat, 16 Jan 2021 19:09:40 +0000 (00:39 +0530)
Handle configuration changes to the mclock cost per io, the max
capacity options and the mclock profile. Handle the case where the
profile is changed from a built-in profile to the custom profile.

Signed-off-by: Sridhar Seshasayee <sseshasa@redhat.com>
src/osd/scheduler/mClockScheduler.cc

index 2b3619111bd3a8f85345c83276ac7e39e38ccb96..74118dca4395ddff59c9b30e72e42a005c2e3c0f 100644 (file)
@@ -418,7 +418,34 @@ void mClockScheduler::handle_conf_change(
   const ConfigProxy& conf,
   const std::set<std::string> &changed)
 {
-  client_registry.update_from_config(conf);
+  if (changed.count("osd_mclock_cost_per_io_msec") ||
+      changed.count("osd_mclock_cost_per_io_msec_hdd") ||
+      changed.count("osd_mclock_cost_per_io_msec_ssd")) {
+    set_osd_mclock_cost_per_io();
+  }
+  if (changed.count("osd_mclock_max_capacity_iops") ||
+      changed.count("osd_mclock_max_capacity_iops_hdd") ||
+      changed.count("osd_mclock_max_capacity_iops_ssd")) {
+    set_max_osd_capacity();
+    enable_mclock_profile();
+    client_registry.update_from_config(conf);
+  }
+  if (changed.count("osd_mclock_profile")) {
+    enable_mclock_profile();
+    if (mclock_profile != "custom") {
+      client_registry.update_from_config(conf);
+    }
+  }
+  if (changed.count("osd_mclock_scheduler_client_res") ||
+      changed.count("osd_mclock_scheduler_client_wgt") ||
+      changed.count("osd_mclock_scheduler_client_lim") ||
+      changed.count("osd_mclock_scheduler_background_recovery_res") ||
+      changed.count("osd_mclock_scheduler_background_recovery_wgt") ||
+      changed.count("osd_mclock_scheduler_background_recovery_lim")) {
+    if (mclock_profile == "custom") {
+      client_registry.update_from_config(conf);
+    }
+  }
 }
 
 }