Repository navigation
osd/scheduler: Classify subOp reads according to op priority for mClock - #64618
Conversation
53d7eee to
970a76e
Compare
|
@athanatos Following up from our discussion, I think I understand what needs to change when determining the cost for a subOpRead. In Line 575 in 5b828b6 For mClock this should be changed to return the object size being recovered and rounded up to the stripe width. Otherwise, this will always be set close to the recovery chunk size (~8 MiB) which is incorrect. Do you agree with this? |
Ah, we submit ECSubRead with the max amount and trust the other side to truncate. There are cases where it has to work that way -- the first request may not actually know the object size since it doesn't have object info xattr yet. I don't think this is worth messing with for now, just use the value actually in the ECSubRead. We can make it more accurate in a followup PR. |
Sure, I will calculate the value from ECSubRead's |
9c05224 to
eabf257
Compare
eabf257 to
c7429e0
Compare
311f0d7 to
06235e6
Compare
|
jenkins test make check |
|
jenkins test api |
|
jenkins test make check arm64 |
|
jenkins test windows |
1 similar comment
|
jenkins test windows |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
b5c1a48 to
d17e764
Compare
|
The latest push (May 21, 2026) adds a bunch of perf counters to help track the queue length and latency of different ops handled within mClock queue and the high_queues. This would be helpful in tracking down issues observed if any during disruptive operations with EC based clusters. Testing Progress Notes
|
d17e764 to
483fb37
Compare
483fb37 to
d874a80
Compare
Teuthology Test Resulthttps://pulpito.ceph.com/sseshasa-2026-05-26_18:29:48-rados-wip-sseshasa-testing-2026-05-26-1779803771-distro-default-trial/ All Failures are Known and Unrelated
|
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
d874a80 to
ed77fc2
Compare
The earlier output formatting was resulting in the value and string representation of the SchedulerClass being clubbed together for e.g., "3client" The formatting is now fixed to log SchedulerClass as "3 (client)". Signed-off-by: Sridhar Seshasayee <[email protected]>
Signed-off-by: Sridhar Seshasayee <[email protected]>
Signed-off-by: Sridhar Seshasayee <[email protected]>
…Clock The change brings MSG_OSD_EC_READ into the fold of mClock scheduler. This improves the scheduling of client and other classes of operation as they are no longer unnecessarily preempted by the 'immediate' queue. EC SubOps are now handled as follows: - EC SubOp reads generated during recovery will either go into the 'background_recovery' or 'background_best_effort' class based on the recovery priority set for the op. EC SubOp reads generated due to client will continue to be classified as 'immediate'. - EC SubOp writes generated as a result of client operations will continue to be classified as 'immediate'. - EC SubOp replies are considered high priority and therefore continue to be classed as 'immediate'. Fixes: https://tracker.ceph.com/issues/71655 Signed-off-by: Sridhar Seshasayee <[email protected]>
…cheduler
Previously, sub-op reads returned a hardcoded cost of 0, bypassing
mClock's background bandwidth and tag calculation mechanisms. This
allowed backfill operations to proceed un-metered, occasionally causing
backend resource contention and driving up client tail latencies.
Cost is calculated based on whether the complete chunk/shard or a subchunk
needs to be read. The possible cases are:
1. Read the complete chunk aligned length:
- Cost is set to the length of the chunk aligned extent size.
2. Fragmented reads:
- Consider the subchunk length and count to calculate the cost.
- compute_cost evaluates the exact layout of fragmented shard bytes on
disk by summing up the active subchunk allocations exactly once
(`fragmented_shard_bytes += k.second * subchunk_size`).
- Linear Extent Scaling: Scale the baseline footprint cleanly by
multiplying it against the true count of read extents (`tl.size()`),
achieving a highly efficient O(N) time complexity.
This linear cost model is compatible with pools running with
'allow_ec_optimizations' set to true. Under the FastEC optimized
pipeline, most operations are unified and bypass fragment slicing,
meaning requests will primarily match the Case 1 chunk-aligned path.
In Case 2 where applicable, the O(N) loop ensures that cost will
scale proportionally according to the layout.
It is important to note that the amount of data to read was set to an upper
bound defined by osd_recovery_max_chunk (8 MiB) and was rounded up to the
stripe width. The reason for setting a higher than actual upper bound is that
there may be cases where the object doesn't have the xattrs yet to determine
its size. Therefore, the amount to read was ultimatly set to ~(8 MiB / k)
where k is the number of data shards. This can cause mClock to prolong
the recovery times as items stay longer in the queue. To address this, the
amount to read is set to the remaining length of the object to recover
if the object size is known. Otherwise, the amount to read is set to the
recovery chunk size as before. Therefore, in some cases, only the first
recovery read could be costly if the object context is not known.
The MOSDECSubOpRead class introduces the following:
- cost member. This necessitates an increment to the HEAD_VERSION and
appropriate handling within the encode and decode methods.
- compute_cost() that is called when creating the message by
ECCommonL::ReadPipeline::do_read_op(). This calls into ECSubRead::cost()
that performs the actual calculations to set the cost based on the cases
mentioned above.
- The same sequence applies to the EC optimized path in
ECCommon::ReadPipeline::do_read_op().
Fixes: https://tracker.ceph.com/issues/71655
Signed-off-by: Sridhar Seshasayee <[email protected]>
Add perf counters to show the status pertaining to the number of ops, dynamic queue lengths, queue latency and bytes read for the following ops handled in the high queues and in the scheduler queues: - peering - client - ec reads/writes - ec recovery reads Additional counters can be added in the future based on the requirement. Signed-off-by: Sridhar Seshasayee <[email protected]>
…tarvation 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 <[email protected]>
…sters Remove the warning that recommends using wpq scheduler as a fallback for EC clusters. This issue is addressed by considering EC recovery reads as background, assigning an accurate cost for those reads and tuning the QoS parameters associated with best-effort class of operations. Signed-off-by: Sridhar Seshasayee <[email protected]>
ed77fc2 to
2cf1e71
Compare









The change brings MSG_OSD_EC_READ into the fold of mClock scheduler. This
improves the scheduling of client and other classes of operation as they
are no longer unnecessarily preempted by the 'immediate' queue.
EC SubOps are now handled as follows:
EC SubOp reads generated during recovery will either go into the
'background_recovery' or 'background_best_effort' class based on
the recovery priority set for the op. EC SubOp reads generated due
to client will continue to be classified as 'immediate'.
EC SubOp writes generated as a result of client operations will
continue to be classified as 'immediate'.
EC SubOp replies are considered high priority and therefore
continue to be classed as 'immediate'.
Fixes: https://tracker.ceph.com/issues/71655
Signed-off-by: Sridhar Seshasayee [email protected]
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job Definition