From 17d6a993fc17d533460c5f40f3908c708e057c18 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 23 May 2024 18:45:17 +0200 Subject: Merging upstream version 18.2.3. Signed-off-by: Daniel Baumann --- src/osd/scheduler/mClockScheduler.h | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) (limited to 'src/osd/scheduler/mClockScheduler.h') diff --git a/src/osd/scheduler/mClockScheduler.h b/src/osd/scheduler/mClockScheduler.h index f708b1d7a..16e7f911f 100644 --- a/src/osd/scheduler/mClockScheduler.h +++ b/src/osd/scheduler/mClockScheduler.h @@ -27,7 +27,6 @@ #include "osd/scheduler/OpScheduler.h" #include "common/config.h" #include "common/ceph_context.h" -#include "common/mClockPriorityQueue.h" #include "osd/scheduler/OpSchedulerItem.h" @@ -97,6 +96,7 @@ class mClockScheduler : public OpScheduler, md_config_obs_t { const uint32_t num_shards; const int shard_id; const bool is_rotational; + const unsigned cutoff_priority; MonClient *monc; /** @@ -199,21 +199,6 @@ class mClockScheduler : public OpScheduler, md_config_obs_t { }; } - 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; - } - } - - unsigned cutoff_priority = get_io_prio_cut(cct); - /** * set_osd_capacity_params_from_config * @@ -233,7 +218,8 @@ class mClockScheduler : public OpScheduler, md_config_obs_t { public: mClockScheduler(CephContext *cct, int whoami, uint32_t num_shards, - int shard_id, bool is_rotational, MonClient *monc); + int shard_id, bool is_rotational, unsigned cutoff_priority, + MonClient *monc); ~mClockScheduler() override; /// Calculate scaled cost per item @@ -260,12 +246,18 @@ public: void dump(ceph::Formatter &f) const final; void print(std::ostream &ostream) const final { - ostream << "mClockScheduler"; + ostream << get_op_queue_type_name(get_type()); + ostream << ", cutoff=" << cutoff_priority; } // Update data associated with the modified mclock config key(s) void update_configuration() final; + // Return the scheduler type + op_queue_type_t get_type() const final { + return op_queue_type_t::mClockScheduler; + } + const char** get_tracked_conf_keys() const final; void handle_conf_change(const ConfigProxy& conf, const std::set &changed) final; -- cgit v1.2.3