]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix: slow scheduling when item_cost is large 53860/head
authorjrchyang <yujrchyang@outlook.com>
Tue, 12 Sep 2023 09:31:28 +0000 (09:31 +0000)
committerLaura Flores <lflores@ibm.com>
Fri, 6 Oct 2023 15:25:45 +0000 (15:25 +0000)
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 <yanghonggang_yewu@cmss.chinamobile.com>
co-author: zhangjianwei <zhangjianwei2_yewu@cmss.chinamobile.com>
Signed-off-by: Jrchyang Yu <yuzhiqiang_yewu@cmss.chinamobile.com>
(cherry picked from commit 65ebf2d6f1b41c93ee2e170437780846d20f5480)

src/osd/scheduler/mClockScheduler.cc

index 4b30766796c6d7897197c1884ada6572f720211c..876fed89e2b78d7ef252ad5caed4007babb0132b 100644 (file)
@@ -338,8 +338,7 @@ uint32_t mClockScheduler::calc_scaled_cost(int item_cost)
       item_cost));
   auto cost_per_io = static_cast<uint32_t>(osd_bandwidth_cost_per_io);
 
-  // Calculate total scaled cost in bytes
-  return cost_per_io + cost;
+  return std::max<uint32_t>(cost, cost_per_io);
 }
 
 void mClockScheduler::update_configuration()