From: Shiyang Ruan Date: Wed, 17 Oct 2018 09:54:20 +0000 (+0800) Subject: librbd: make the minimum of schedule tick for QoS configurable. X-Git-Tag: v14.1.0~946^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fd613b1c32cd64154a76e88bb094b46ce9baabb5;p=ceph.git librbd: make the minimum of schedule tick for QoS configurable. Signed-off-by: Shiyang Ruan --- diff --git a/qa/suites/rbd/thrash/workloads/rbd_fsx_rate_limit.yaml b/qa/suites/rbd/thrash/workloads/rbd_fsx_rate_limit.yaml index 6d215c62b4b..611320bca15 100644 --- a/qa/suites/rbd/thrash/workloads/rbd_fsx_rate_limit.yaml +++ b/qa/suites/rbd/thrash/workloads/rbd_fsx_rate_limit.yaml @@ -8,3 +8,4 @@ overrides: client: rbd qos iops limit: 50 rbd qos iops burst: 100 + rbd qos schedule tick min: 100 diff --git a/src/common/Throttle.cc b/src/common/Throttle.cc index 015ee09c357..8e026bfdb9f 100644 --- a/src/common/Throttle.cc +++ b/src/common/Throttle.cc @@ -764,6 +764,13 @@ int TokenBucketThrottle::set_limit(uint64_t average, uint64_t burst) { return 0; } +void TokenBucketThrottle::set_schedule_tick_min(uint64_t tick) { + std::lock_guard lock(m_lock); + if (tick != 0) { + m_tick_min = tick; + } +} + uint64_t TokenBucketThrottle::tokens_filled(double tick) { return (0 == m_avg) ? 0 : (tick / m_ticks_per_second * m_avg); } diff --git a/src/common/Throttle.h b/src/common/Throttle.h index d66051c1b43..5e506cdb3e9 100644 --- a/src/common/Throttle.h +++ b/src/common/Throttle.h @@ -368,7 +368,7 @@ class TokenBucketThrottle { Mutex m_lock; // minimum of the filling period. - static const uint64_t m_tick_min = 50; + uint64_t m_tick_min = 50; // tokens filling period, its unit is millisecond. uint64_t m_tick = 0; /** @@ -446,6 +446,7 @@ public: } int set_limit(uint64_t average, uint64_t burst); + void set_schedule_tick_min(uint64_t tick); private: uint64_t tokens_filled(double tick); diff --git a/src/common/options.cc b/src/common/options.cc index 7f75b07b719..cf15115663e 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -6700,6 +6700,11 @@ static std::vector