]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Change default value of osd_pg_delete_cost 48192/head
authorAishwarya Mathuria <amathuri@redhat.com>
Tue, 20 Sep 2022 14:25:59 +0000 (19:55 +0530)
committerAishwarya Mathuria <amathuri@redhat.com>
Tue, 17 Jan 2023 15:26:50 +0000 (20:56 +0530)
osd_pg_delete_cost defines the cost of the PG deletion operation.
This cost is used by WPQ to determine which operation should be dequeued. Lower the cost, higher the chance of the operation being dequeued next.
mClock scheduler uses the cost parameter in a similar way.
However, with the osd_delete_sleep_ssd and osd_delete_sleep_hdd options disabled with mClock, we noticed that PG deletion was completing much faster with mClock scheduler.
In order to achieve behavior similar to WPQ with mClock scheduler, the osd_pg_delete_cost has been increased.

Signed-off-by: Aishwarya Mathuria <amathuri@redhat.com>
src/osd/OSD.cc
src/osd/OSD.h

index 9a7e04a7d2d0e2411c2ccf0e8ac9be8d4657aa5c..0aa664147219c23308ca4b011c390cff4b983dcd 100644 (file)
@@ -3886,6 +3886,7 @@ int OSD::init()
 
   // Override a few options if mclock scheduler is enabled.
   maybe_override_sleep_options_for_qos();
+  maybe_override_cost_for_qos();
   maybe_override_options_for_qos();
   maybe_override_max_osd_capacity_for_qos();
 
@@ -9670,6 +9671,9 @@ void OSD::handle_conf_change(const ConfigProxy& conf,
       changed.count("osd_recovery_sleep_hybrid")) {
     maybe_override_sleep_options_for_qos();
   }
+  if (changed.count("osd_pg_delete_cost")) {
+    maybe_override_cost_for_qos();
+  }
   if (changed.count("osd_min_recovery_priority")) {
     service.local_reserver.set_min_priority(cct->_conf->osd_min_recovery_priority);
     service.remote_reserver.set_min_priority(cct->_conf->osd_min_recovery_priority);
@@ -9982,6 +9986,17 @@ void OSD::maybe_override_sleep_options_for_qos()
   }
 }
 
+void OSD::maybe_override_cost_for_qos()
+{
+  // If the scheduler enabled is mclock, override the default PG deletion cost
+  // so that mclock can meet the QoS goals.
+  if (cct->_conf.get_val<std::string>("osd_op_queue") == "mclock_scheduler" &&
+      !unsupported_objstore_for_qos()) {
+    uint64_t pg_delete_cost = 15728640;
+    cct->_conf.set_val("osd_pg_delete_cost", std::to_string(pg_delete_cost));
+  }
+}
+
 /**
  * A context for receiving status from a background mon command to set
  * a config option and optionally apply the changes on each op shard.
index 938860fcafeefe9b737e7cba42093e3c960bc4b5..2b04ad3516d4ffca933a328f19a24d6514cef2c3 100644 (file)
@@ -2024,6 +2024,7 @@ private:
   void maybe_override_sleep_options_for_qos();
   bool maybe_override_options_for_qos(
     const std::set<std::string> *changed = nullptr);
+  void maybe_override_cost_for_qos();
   int run_osd_bench_test(int64_t count,
                          int64_t bsize,
                          int64_t osize,