From 3388fe9de7c779f60723b4b070b8d9ce307f08a6 Mon Sep 17 00:00:00 2001 From: jrchyang Date: Tue, 12 Sep 2023 09:31:28 +0000 Subject: [PATCH] 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) --- src/osd/scheduler/mClockScheduler.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/osd/scheduler/mClockScheduler.cc b/src/osd/scheduler/mClockScheduler.cc index 4b30766796c6d..876fed89e2b78 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() -- 2.39.5