]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #49482 from amathuria/wip-amathuria-mclock-high-prio-queue
authorLaura Flores <lflores@redhat.com>
Mon, 27 Feb 2023 23:55:43 +0000 (17:55 -0600)
committerGitHub <noreply@github.com>
Mon, 27 Feb 2023 23:55:43 +0000 (17:55 -0600)
mClock: Add ability to handle high priority operations

1  2 
src/osd/scheduler/mClockScheduler.cc
src/osd/scheduler/mClockScheduler.h
src/test/osd/TestMClockScheduler.cc

Simple merge
index dbacc348e6f10b601563efe9ecb60a0f2ea374c3,088df31ee190c6e230010a4bf3d0bc9ca41aedda..053dd1e87fd7598d3a371fd976fcfe854a31cc3b
@@@ -146,9 -155,21 +158,22 @@@ class mClockScheduler : public OpSchedu
      };
    }
  
+   static unsigned int get_io_prio_cut(CephContext *cct) {
+     if (cct->_conf->osd_op_queue_cut_off == "debug_random") {
+       std::random_device rd;
+       std::mt19937 random_gen(rd());
+       return (random_gen() % 2 < 1) ? CEPH_MSG_PRIO_HIGH : CEPH_MSG_PRIO_LOW;
+     } else if (cct->_conf->osd_op_queue_cut_off == "high") {
+       return CEPH_MSG_PRIO_HIGH;
+     } else {
+       // default / catch-all is 'low'
+       return CEPH_MSG_PRIO_LOW;
+     }
+   }
  public:
 -  mClockScheduler(CephContext *cct, uint32_t num_shards, bool is_rotational);
 +  mClockScheduler(CephContext *cct, int whoami, uint32_t num_shards,
 +    int shard_id, bool is_rotational, MonClient *monc);
    ~mClockScheduler() override;
  
    // Set the max osd capacity in iops
Simple merge