From 0e26bb3173574f000f2574eb902058f207b3c6cc Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Wed, 12 Feb 2025 19:45:42 -0800 Subject: [PATCH] osd/scheduler/mClockScheduler: add constructor to specify idle/erase/check times Useful for unit test, default times are *really* long. Signed-off-by: Samuel Just (cherry picked from commit 8b7b0463792d85575996e65752087a25c9a3a65a) --- src/osd/scheduler/mClockScheduler.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/osd/scheduler/mClockScheduler.h b/src/osd/scheduler/mClockScheduler.h index 84170adaaeb..7ef2c05a693 100644 --- a/src/osd/scheduler/mClockScheduler.h +++ b/src/osd/scheduler/mClockScheduler.h @@ -228,9 +228,13 @@ class mClockScheduler : public OpScheduler, md_config_obs_t { void set_config_defaults_from_profile(); public: + template mClockScheduler( CephContext *cct, int whoami, uint32_t num_shards, int shard_id, bool is_rotational, unsigned cutoff_priority, + std::chrono::duration idle_age, + std::chrono::duration erase_age, + std::chrono::duration check_time, MonClient *monc, bool init_perfcounter=true) : cct(cct), @@ -245,6 +249,7 @@ public: std::bind(&mClockScheduler::ClientRegistry::get_info, &client_registry, std::placeholders::_1), + idle_age, erase_age, check_time, crimson::dmclock::AtLimit::Wait, cct->_conf.get_val("osd_mclock_scheduler_anticipation_timeout")) { @@ -259,6 +264,17 @@ public: _init_logger(); } } + mClockScheduler( + CephContext *cct, int whoami, uint32_t num_shards, + int shard_id, bool is_rotational, unsigned cutoff_priority, + MonClient *monc, + bool init_perfcounter=true) : + mClockScheduler( + cct, whoami, num_shards, shard_id, is_rotational, cutoff_priority, + crimson::dmclock::standard_idle_age, + crimson::dmclock::standard_erase_age, + crimson::dmclock::standard_check_time, + monc, init_perfcounter) {} ~mClockScheduler() override; /// Calculate scaled cost per item -- 2.39.5