]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mClockScheduler: Set priority cutoff in the mClock Scheduler 50691/head
authorAishwarya Mathuria <amathuri@redhat.com>
Thu, 23 Mar 2023 13:19:56 +0000 (18:49 +0530)
committerAishwarya Mathuria <aishwaryamathuria@li-9e0a7d4c-34fa-11b2-a85c-bf340f364250.ibm.com>
Tue, 9 May 2023 13:32:37 +0000 (19:02 +0530)
We check the priority of an op before deciding if it gets enqueued in
the high_priority_queue or the mClock scheduler queue. Instead of
checking what osd_op_queue_cut_off is set to each time, we should be
checking the cutoff only once and set that as the priority_cutoff. This
will avoid any issues when osd_op_queue_cut_off is set to debug_random.

Fixes: https://tracker.ceph.com/issues/58940
Signed-off-by: Aishwarya Mathuria <amathuri@redhat.com>
src/osd/scheduler/mClockScheduler.cc
src/osd/scheduler/mClockScheduler.h

index 5f2edfab1f17acec525e375c451be106607dca7a..079e41ea1d11d1f4efaefe6c64c1e6b058be4cc3 100644 (file)
@@ -386,12 +386,11 @@ void mClockScheduler::enqueue(OpSchedulerItem&& item)
 {
   auto id = get_scheduler_id(item);
   unsigned priority = item.get_priority();
-  unsigned cutoff = get_io_prio_cut(cct);
   
   // TODO: move this check into OpSchedulerItem, handle backwards compat
   if (op_scheduler_class::immediate == id.class_id) {
     enqueue_high(immediate_class_priority, std::move(item));
-  } else if (priority >= cutoff) {
+  } else if (priority >= cutoff_priority) {
     enqueue_high(priority, std::move(item));
   } else {
     auto cost = calc_scaled_cost(item.get_cost());
@@ -424,12 +423,11 @@ void mClockScheduler::enqueue(OpSchedulerItem&& item)
 void mClockScheduler::enqueue_front(OpSchedulerItem&& item)
 {
   unsigned priority = item.get_priority();
-  unsigned cutoff = get_io_prio_cut(cct);
   auto id = get_scheduler_id(item);
 
   if (op_scheduler_class::immediate == id.class_id) {
     enqueue_high(immediate_class_priority, std::move(item), true);
-  } else if (priority >= cutoff) {
+  } else if (priority >= cutoff_priority) {
     enqueue_high(priority, std::move(item), true);
   } else {
     // mClock does not support enqueue at front, so we use
index fc2f79b8cd7bc7cd27f3dfeabf7c794f546cf8bb..5c443e66b0004c1a0982ed1ccfd1e89dbb45b238 100644 (file)
@@ -197,6 +197,8 @@ class mClockScheduler : public OpScheduler, md_config_obs_t {
     }
   }
 
+  unsigned cutoff_priority = get_io_prio_cut(cct);
+
   /**
    * set_osd_capacity_params_from_config
    *
@@ -214,7 +216,7 @@ class mClockScheduler : public OpScheduler, md_config_obs_t {
   // Set the mclock related config params based on the profile
   void set_config_defaults_from_profile();
 
-public:
+public: 
   mClockScheduler(CephContext *cct, int whoami, uint32_t num_shards,
     int shard_id, bool is_rotational, MonClient *monc);
   ~mClockScheduler() override;