From: jrchyang Date: Tue, 12 Sep 2023 09:31:28 +0000 (+0000) Subject: osd: fix: slow scheduling when item_cost is large X-Git-Tag: v17.2.7~37^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F53860%2Fhead;p=ceph.git osd: fix: slow scheduling when item_cost is large We use the iops and bandwidth tested by `ceph tell osd.0 bench 10737418240 204800 204800 100` to verify the QoS function. iops was 400 and bandwidth was 80MiB/s. When osd_mclock_scheduler_client_lim is set to 1, the sequential write bandwidth is only half of the capacity. Therefore, we believe that it should not unconditionally increase osd_bandwidth_cost_per_io for each IO, but take the maximum of the two. Fixes: https://tracker.ceph.com/issues/62812 co-author: yanghonggang co-author: zhangjianwei Signed-off-by: Jrchyang Yu (cherry picked from commit 65ebf2d6f1b41c93ee2e170437780846d20f5480) --- diff --git a/src/osd/scheduler/mClockScheduler.cc b/src/osd/scheduler/mClockScheduler.cc index 4b30766796c6..876fed89e2b7 100644 --- a/src/osd/scheduler/mClockScheduler.cc +++ b/src/osd/scheduler/mClockScheduler.cc @@ -338,8 +338,7 @@ uint32_t mClockScheduler::calc_scaled_cost(int item_cost) item_cost)); auto cost_per_io = static_cast(osd_bandwidth_cost_per_io); - // Calculate total scaled cost in bytes - return cost_per_io + cost; + return std::max(cost, cost_per_io); } void mClockScheduler::update_configuration()