Repository navigation
debian: build with ninja - #73067
debian: build with ninja#73067
Conversation
2749fe5 to
c9f4689
Compare
|
Peak RSS of each link's whole process tree, with
|
|
@tchaikov do you know how much time does it add to the build process? |
| if(CMAKE_INTERPROCEDURAL_OPTIMIZATION OR | ||
| "${CMAKE_CXX_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}" MATCHES "-flto") | ||
| # ld, the WPA stage and its LTRANS jobs of a single LTO link | ||
| set(MAX_LINK_MEM 6000 CACHE INTERNAL "maximum memory used by each linking job (in MiB)") |
There was a problem hiding this comment.
| set(MAX_LINK_MEM 6000 CACHE INTERNAL "maximum memory used by each linking job (in MiB)") | |
| set(MAX_LINK_MEM 8000 CACHE INTERNAL "maximum memory used by each linking job (in MiB)") |
decrease the number of parallel links little further, since ubuntu noble still OOM here:
https://shaman.ceph.com/builds/ceph/wip-pr-73067-kefu/c9f4689ce8aff8ac6738a643dc0e6649d19481d1/
There was a problem hiding this comment.
i was looking at it as well. the pools did limit it to 21 heavy links, but each one ran about 71 LTRANS jobs, around 12.4 GB per link. with make, -flto=auto takes job slots from make's jobserver. ninja doesn't have one, so every link starts an LTRANS job per CPU thread. so, in the latest revision, we now pass -flto=N to the linker, where N is the number of CPU threads divided by the heavy pool size.
c9f4689 to
d7adc87
Compare
(estimation of peak memory: sum of the per-job peak RSS of the jobs running at the same time.) I measured what this PR costs. across two full local LTO builds, the LTRANS cap changed the build time by less than 1%.
i don't have strong preferences. but i think we don't have to pick one -- we can have both of them. actually, what surprised me more is the package size. The linker only pulls in archive members that something references, but
@mheler is already working on this. his EDIT, i just found #73063 which builds |
I think both my PR and @tchaikov is the right direction. However I feel both are trying to solve symptoms of the problem. I did some digging, and the noble and jammy builds started failing in #72180 , I believe this is due to the fact the RadosVectorBucket became a subclass of RadosBucket with an inline destructor. Every rgw file that deletes a Bucket gets a copy of that destructor, and each copy needs RadosStore, so even the small rgw test and tool binaries now link most of rgw_common. That makes every rgw link heavier, and the debs are the ones that tip over. Before that merge, jammy and noble passed every time on the 264 GiB builders, and since then they mostly fail, while the rpm builds still pass on the same builders. Defining the destructor out of line, like RadosBucket's, should fix it, and I'm putting it through ceph-ci to confirm. |
|
@tchaikov did you test with clang? $ cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_EXE_LINKER_FLAGS=-flto ..i got: $ ninja radosgw
[48/84] Linking CXX shared library lib/libceph-common.so.2
FAILED: lib/libceph-common.so.2
...
clang++: error: unsupported argument '3' to option '-flto=' |
d7adc87 to
213753a
Compare
just tested. and it seems like clang does not support |
|
Claude suggests bumping https://github.com/tchaikov/ceph/blob/wip-deb-ninja/debian/control#L17 since cmake+ninja arrived in debhelper 11.2. |
213753a to
a5cc2fa
Compare
@djgalloway hi David, thanks! indeed. actually, |
|
@tchaikov, thanks for the debhelper bump to 12. That item is resolved. gcc 11 blocks the mergeThe "cmake: cap the LTRANS jobs of each LTO link" commit doesn't work on jammy. Ubuntu's I intercepted the
The CI history matches. The PR description cites build 10226, which OOMed on noble before the cap was added. The only dev-pipeline build of the capped version, 10249, also failed, on jammy x86_64 default on soko11 (80 threads, 251 GiB). All 270 link lines have
In the same commit, replace Before merge#73063 merged today, so the memory tables in the two cmake commits are stale. They were measured against the static Both cmake commits affect every Ninja + LTO build. RPM builds on el9/el10 will get fewer concurrent links and a 9-thread LTRANS cap on a 192-thread builder. Please mention that in the commit messages. Before merge, please run the final head through dev-pipeline with jammy and noble on a gigantic node and get a green result. Please also link both failed builds in the description. The "debian: build with ninja" commit is independent and fine on its own. If the dev-pipeline failures are holding things up, that commit could be split out and merged now. Minor points I mentioned before: the cap applies to all links but is sized from the heavy pool; LTO detection misses |
876ebb1 to
02f08a0
Compare
|
@djgalloway Thanks, David. I folded the GCC 11 fix into the CMake commit and verified that |
Use the compile and link pools in LimitJobs for Debian package builds. With Make, several memory-intensive links can start together as soon as their common dependencies finish. Ninja lets us limit concurrent links separately while keeping the rest of the package build parallel. Select cmake+ninja for all debhelper build steps. It requires debhelper 11.2 or later. Raise the minimum to 12 to match debian/compat. Refs: https://tracker.ceph.com/issues/82052 Signed-off-by: Kefu Chai <[email protected]>
Without a jobserver, GCC's -flto=auto can start an LTRANS worker per CPU in each concurrent link. Divide the CPU count by the heavy link pool size and use the result for automatic LTO links in either pool. This also applies to Ninja RPM builds on EL9 and EL10. A 192-thread host with 255 GiB has 29 heavy slots at the existing 4500 MiB budget, giving six workers per link. Replace -flto=auto in the C/C++ compile flags, executable, shared and module linker flags, active configuration flags, and GNU IPO options. GCC 11 remembers auto even after a later -flto=N. Jammy's GCC 11.4 ran make -j32 for -flto=auto -flto=2 and make -j2 after replacement. Keep explicit GCC job counts and use -flto-jobs=N for Clang ThinLTO. After ceph#73063, RGW loads librgw_lancedb.so.1. Peak process-tree PSS in GiB on GCC 14.2, using the same -O2 -g fat LTO objects, 32 CPUs and three heavy slots: target auto N=10 radosgw 6.61 3.99 librgw.so 5.86 4.27 radosgw-admin 5.55 4.18 denc-mod-rgw.so 6.01 4.24 ceph-osd 4.77 2.42 crimson-osd 9.82 6.14 Both radosgw-admin and denc-mod-rgw used a GNU ld archive group in both runs. The capped peaks fit the existing heavy pool allowance of about 9000 MiB per slot. Signed-off-by: Kefu Chai <[email protected]>
02f08a0 to
1c53f97
Compare
Build Debian packages with Ninja so Ceph's compile and link pools limit concurrent links. Keep the existing 4500 MiB link budget. The GCC change bounds automatic LTRANS parallelism for links in either pool, including Ninja RPM builds on EL9 and EL10. On a 192-thread builder with 255 GiB, the existing pool has 29 heavy slots, giving six workers per link. Explicit GCC job counts are preserved.
Two earlier package builds explain why both changes are needed:
-flto=autoactive even with a later numeric flag. Replacing the flag also in distro compile/link flags and CMake IPO options fixed this in a GCC 11.4 probe: with a requested cap of two, the actual make invocation changed from-j32to-j2.Dev-pipeline 11117 was started on the identical source tree at
876ebb14189with the standard x86_64 matrix, including Jammy and Noble.Memory after #73063
Measured on a 32-thread host using GCC 14.2,
-O2 -g -ffat-lto-objects, and three heavy link slots. The table gives peak summed process-tree PSS in GiB, sampled every 250 ms, using the same objects for each pair. RGW's ELF dependencies includelibrgw_lancedb.so.1.-flto=auto-flto=10radosgwlibrgw.soradosgw-admindenc-mod-rgw.soceph-osdcrimson-osdThe existing heavy pool allows about 9000 MiB per slot. These measurements support keeping it. For
radosgw-adminanddenc-mod-rgw.so, both measurements used GNU ld with the archives in a--start-group/--end-grouppair to resolve local link-order errors.Refs: https://tracker.ceph.com/issues/82052
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.