Repository navigation
mclock : Refactor the mClock scheduler source code - #63516
Merged
Merged
Conversation
Contributor
Author
|
jenkins test make check |
14 tasks
sseshasa
requested changes
May 28, 2025
sseshasa
left a comment
Contributor
There was a problem hiding this comment.
Mostly looks good to me other than a couple of queries, some minor nits around line lengths and trailing whitespaces.
Contributor
Author
|
jenkins test make check |
Contributor
Author
|
jenkins test make check |
sseshasa
reviewed
May 28, 2025
sseshasa
reviewed
May 28, 2025
Contributor
Author
|
jenkins test make check |
sseshasa
reviewed
May 28, 2025
sseshasa
reviewed
May 28, 2025
sseshasa
reviewed
May 28, 2025
sseshasa
reviewed
May 28, 2025
sseshasa
reviewed
May 28, 2025
Contributor
Author
|
jenkins test make check |
Contributor
Author
|
jenkins test make check |
sseshasa
approved these changes
May 29, 2025
sseshasa
left a comment
Contributor
There was a problem hiding this comment.
Changes LGTM. Let's get this through testing.
Contributor
Author
|
jenkins test make check |
sseshasa
reviewed
Jun 9, 2025
Contributor
There was a problem hiding this comment.
Looks like the new call (std::invoke_result) uses a different syntax. Can you check and fix the same?
Refactor the mClock scheduler source code into a common module so that both Classic and Crimson OSDs can use it. Fixes: https://tracker.ceph.com/issues/71445 Signed-off-by: Mohit Agrawal <[email protected]>
std::result_of is removed in c++20 so replace it with std::invoke_result Fixes: https://tracker.ceph.com/issues/71445 Signed-off-by: Mohit Agrawal <[email protected]>
Contributor
Author
|
jenkins test make check |
Contributor
Author
|
@athanatos Can you please review this a1f6173 , the change is in dmclock code path. |
Contributor
|
jenkins test api |
Contributor
|
jenkins test make check arm64 |
Member
|
jenkins test api |
Contributor
sseshasa
added a commit
to sseshasa/ceph
that referenced
this pull request
Jun 29, 2026
…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]> (cherry picked from commit a0464c3) Conflicts: src/osd/scheduler/OpSchedulerItem.h - enum SchedulerClass doesn't exist in tentacle.Therefore, the original enum op_scheduler_class is used. enum SchedulerClass was introduced when mclock_common.h/cc was created as a refactor in later releases to share common bits between classic and crimson OSDs. Introduced in PR: ceph#63516.
sseshasa
added a commit
to sseshasa/ceph
that referenced
this pull request
Jun 29, 2026
… 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 <[email protected]> (cherry picked from commit 77421c8) 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: ceph#63516. Therefore, the profile parameters change is added to the original location in src/osd/mClockScheduler.cc.
sseshasa
added a commit
to sseshasa/ceph
that referenced
this pull request
Jun 29, 2026
… 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 <[email protected]> (cherry picked from commit 77421c8) Conflicts: - src/common/mclock_common.h doesn't exist in squid. mclock_common.h/cc was created as a refactor in later releases to share common bits between classic and crimson OSDs. Introduced in PR: ceph#63516. Therefore, the profile parameters change is added to the original location in src/osd/mClockScheduler.cc.
sseshasa
added a commit
to sseshasa/ceph
that referenced
this pull request
Jul 14, 2026
… 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 <[email protected]> (cherry picked from commit 77421c8) Conflicts: - src/common/mclock_common.h doesn't exist in squid. mclock_common.h/cc was created as a refactor in later releases to share common bits between classic and crimson OSDs. Introduced in PR: ceph#63516. Therefore, the profile parameters change is added to the original location in src/osd/mClockScheduler.cc.
mertsunacoglu
pushed a commit
to mertsunacoglu/ceph
that referenced
this pull request
Aug 26, 2026
…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]> (cherry picked from commit a0464c3) Conflicts: src/osd/scheduler/OpSchedulerItem.h - enum SchedulerClass doesn't exist in tentacle.Therefore, the original enum op_scheduler_class is used. enum SchedulerClass was introduced when mclock_common.h/cc was created as a refactor in later releases to share common bits between classic and crimson OSDs. Introduced in PR: ceph#63516.
mertsunacoglu
pushed a commit
to mertsunacoglu/ceph
that referenced
this pull request
Aug 26, 2026
… 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 <[email protected]> (cherry picked from commit 77421c8) 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: ceph#63516. Therefore, the profile parameters change is added to the original location in src/osd/mClockScheduler.cc.
batrick
pushed a commit
that referenced
this pull request
Oct 20, 2026
…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]> (cherry picked from commit a0464c3) Conflicts: src/osd/scheduler/OpSchedulerItem.h - enum SchedulerClass doesn't exist in squid. Therefore, the original enum op_scheduler_class is used. enum SchedulerClass was introduced when mclock_common.h/cc was created as a refactor in later releases to share common bits between classic and crimson OSDs. Introduced in PR: #63516.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor the mClock scheduler source code into a common module so that both Classic and Crimson OSDs can use it.
Fixes: https://tracker.ceph.com/issues/71445
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