Repository navigation
osd/OSDMap: don't copy the map to compute a read balance score - #73044
Merged
SrinivasaBharath merged 1 commit intoNov 25, 2026
Merged
Conversation
4 of 14 tasks
calc_read_balance_score made a deepish copy of the whole OSDMap and scored the copy, and get_pgs_by_osd, which the score calls for every pool, made another copy to map the pool's PGs. Nothing changes either copy: every call made on them is const, and deepish_copy_from doesn't copy the CRUSH map anyway. Use the map itself in both, and drop the OSDMap argument from calc_rbs_fair and calc_rbs_size_optimal, which only read it. OSDMap::dump scores every replicated pool, so each dump copied the map twice per replicated pool, including every pg_upmap_items entry. The mgr dumps osd_map under the GIL for its Python modules, and the mons dump it for osd dump and osd pool ls detail. Fixes: https://tracker.ceph.com/issues/82062 Signed-off-by: Anthony D'Atri <[email protected]> Assisted-by: Claude Opus-5.5
anthonyeleven
force-pushed
the
wip-osdmap-read-balance-no-copy
branch
from
October 24, 2026 05:52
e0d3505 to
1a27404
Compare
Contributor
Author
|
Build and test results, on a CentOS Stream 9 container with GCC 11.5,
The JSON output is byte-identical in all three. |
Contributor
Author
idryomov
approved these changes
Nov 2, 2026
idryomov
left a comment
Contributor
There was a problem hiding this comment.
I was looking at other @anthonyeleven's PRs in this area and this one seems more than sensible to me.
4 of 14 tasks
anthonyeleven
added a commit
to anthonyeleven/ceph
that referenced
this pull request
Nov 4, 2026
Keep the pools loop in OSDMap::dump(), which now passes true for dump_pool()'s with_read_balance parameter, and have the osd_map_pools getter call dump_pool() for each pool itself, without the read balance scores. Also drop "copy the map" from the getter's comment, since ceph#73044 stops the read balance score from copying the OSDMap. Signed-off-by: Anthony D'Atri <[email protected]> Assisted-by: Claude Opus-5.5
anthonyeleven
added a commit
to anthonyeleven/ceph
that referenced
this pull request
Nov 4, 2026
ceph#73044 removes the OSDMap copies that calc_read_balance_score() and get_pgs_by_osd() make, so drop "copy the map" from the osd_map getter comment. This is the wording Ilya Dryomov suggested on ceph#72719. Fixes: https://tracker.ceph.com/issues/82063 Signed-off-by: Anthony D'Atri <[email protected]> Assisted-by: Claude Opus-5.5
Contributor
|
This PR has been added to wip-bharath10-testing-20261109.054620-main. |
ljflores
approved these changes
Nov 12, 2026
This was referenced Nov 18, 2026
This was referenced Dec 2, 2026
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.
Fixes: https://tracker.ceph.com/issues/82062
OSDMap::calc_read_balance_scoremade adeepish_copy_fromof the whole OSDMap and scored the copy, andget_pgs_by_osd, which the score calls for every pool, made another copy to map the pool's PGs. Nothing changes either copy: every call made on them is const, anddeepish_copy_fromdoesn't copy the CRUSH map anyway. This uses the map itself in both and drops the OSDMap argument fromcalc_rbs_fairandcalc_rbs_size_optimal, which only read it.OSDMap::dumpscores every replicated pool, so each dump copied the map twice per replicated pool, including everypg_upmap_itemsentry. The mgr dumpsosd_mapunder the GIL whenever a Python module asks for it, and the mons do the same forosd dumpandosd pool ls detail.Measured with
osdmaptool --dump jsonon one host, using the map of a Reef cluster with 1,018 OSDs, 134 replicated pools and 10,108pg_upmap_itemsentries:The output is byte-identical. Each copy took about 1.7 ms, twice per replicated pool. Most of the remaining time is spent mapping every PG of every replicated pool for the scores. #73045 leaves the scores out of the mgr's
osd_mapgetter. The prometheus module readsosd_maptwice per collection, and on that cluster the mgr stops dispatching messages for about 7 s each time.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 DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.
Signed-off-by: Anthony D'Atri [email protected]
Assisted-by: Claude Opus-5.5