]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mClockScheduler: adjust mClock profile parameters to prevent backfill starvation 69773/head
authorSridhar Seshasayee <sridhar.seshasayee@ibm.com>
Mon, 25 May 2026 12:14:54 +0000 (17:44 +0530)
committerSridhar Seshasayee <sridhar.seshasayee@ibm.com>
Mon, 29 Jun 2026 10:32:54 +0000 (16:02 +0530)
commitd534b299beeff2ee3f476579cbc64b4c4a093efb
tree54c666542d01ed8b0c4d0d39dbd5f90f45ec6670
parent5674234892ebd1b54d59e614551ca6bbb1ae62a7
mClockScheduler: adjust mClock profile parameters to prevent backfill starvation

Adjust the 'background_best_effort' queue parameters across the
three standard mClock profiles (high_client_ops, balanced, and
high_recovery_ops) to ensure best effort ops are not starved.

Previously, the 'background_best_effort' queue carried a default allocation
of 0% (MIN) reservation and a weight of 1 under these profiles. When
concurrent client traffic is dense, the zero-reservation for example completely
starves backfill sub-ops (MSG_OSD_EC_READ) on pools with
'allow_ec_optimizations' set to false. This starvation forces the Primary OSD
to hold internal BlueStore transactions and PG object locks for extended
windows, causing severe client median (50th) latency inflation.

To prevent background starvation and resolve the effects of the primary lock
retention, the profile configurations are tuned as follows:

The following profile changes forces low-cost sub-ops to clear out of peer
queues rapidly to drop  primary locks, which helps improve the client
completion latency and tail latency (95th, 99th and 99.5th) percentile.

1. high_client_ops profile:
   - Grant 'background_best_effort' a safe 5% minimum reservation.
   - Scale the queue weight to 4.

2. balanced profile:
   - Grant 'background_best_effort' a 5% minimum reservation.
   - Set the queue weight to 2.

3. high_recovery_ops profile:
   - Grant 'background_best_effort' a 5% minimum reservation.
   - Set the queue weight to 2.

4. Modify the mClock config reference documentation to reflect the tuning
   changes to the best-effort QoS parameters across the profiles.

Note on Proportional Scaling Compatibility:
Configuring these changes shifts total reservations to 105% (e.g., 50%
client + 50% recovery + 5% best-effort under the Balanced profile). Under
heavy concurrent saturation, mClock's internal controls resolves this
gracefully via proportional down-scaling, preserving the underlying
device bandwidth limits for different classes of clients. For example instead
of the client being allocated 50% bandwidth, a slightly lower reservation is
allocated while shifting the remaining bandwidth to the best-effort queue.
This minor scaling shift is virtually unnoticeable to the client application,
but it prevents the internal queue deadlocks.

Signed-off-by: Sridhar Seshasayee <sridhar.seshasayee@ibm.com>
(cherry picked from commit 77421c83665fdfd3343c487793e37e003d8c1891)

Conflicts:
        src/common/mclock_common.h
- src/common/mclock_common.h doesn't exist in tentacle.
  mclock_common.h/cc was created as a refactor in later releases to share
  common bits between classic and crimson OSDs. Introduced in PR:
  https://github.com/ceph/ceph/pull/63516.

  Therefore, the profile parameters change is added to the original
  location in src/osd/mClockScheduler.cc.
doc/rados/configuration/mclock-config-ref.rst
src/osd/scheduler/mClockScheduler.cc