Commit d69d8aa8 authored by Nico Weber's avatar Nico Weber

build: Bump number of parallel LTO jobs up to 6, but keep it at 1 for goma lto.

A follow-up to https://chromium-review.googlesource.com/c/chromium/src/+/2467360

android-official is no longer timing out with that change (
https://ci.chromium.org/p/chromium/builders/ci/android-official/2242
https://ci.chromium.org/p/chromium/builders/ci/android-official/2243
), but builds are still much slower than before.

Try doubling number of tasks and see what that does.

I suppose the thinlto cache means that concurrent links save some
time for each other -- even if the cpus are oversubscribed, every
running link can do work that the other links do.

The CrOS ebuild set link parallelism to 1, so explicitly do this
if goma lto is on, so that we don't increase the load on goma from
lto tasks.

Bug: 1132930,1137812
Change-Id: If2b451fa3dc69f7ecde05e581ddb46addc901118
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2468740
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: default avatarHans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#816759}
parent 16bb182f
...@@ -23,10 +23,12 @@ declare_args() { ...@@ -23,10 +23,12 @@ declare_args() {
if (concurrent_links == -1) { if (concurrent_links == -1) {
if (use_thin_lto) { if (use_thin_lto) {
_args = [ _args = [ "--reserve_mem_gb=10" ]
"--thin-lto", if (use_goma_thin_lto) {
"--reserve_mem_gb=10", _args += [ "--thin-lto=goma" ]
] } else {
_args += [ "--thin-lto=local" ]
}
if (is_win) { if (is_win) {
# Based on measurements of linking chrome.dll and chrome_child.dll, plus # Based on measurements of linking chrome.dll and chrome_child.dll, plus
# a little padding to account for future growth. # a little padding to account for future growth.
......
...@@ -57,7 +57,7 @@ def _GetTotalMemoryInBytes(): ...@@ -57,7 +57,7 @@ def _GetTotalMemoryInBytes():
return 0 return 0
def _GetDefaultConcurrentLinks(per_link_gb, reserve_gb, is_thin_lto, def _GetDefaultConcurrentLinks(per_link_gb, reserve_gb, thin_lto_type,
secondary_per_link_gb): secondary_per_link_gb):
explanation = [] explanation = []
explanation.append( explanation.append(
...@@ -72,10 +72,15 @@ def _GetDefaultConcurrentLinks(per_link_gb, reserve_gb, is_thin_lto, ...@@ -72,10 +72,15 @@ def _GetDefaultConcurrentLinks(per_link_gb, reserve_gb, is_thin_lto,
except: except:
cpu_count = 1 cpu_count = 1
# LTO links saturate all cores, but only for about a third of a link. # A local LTO links saturate all cores, but only for some amount of the link.
# Goma LTO runs LTO codegen on goma, only run one of these tasks at once.
cpu_cap = cpu_count cpu_cap = cpu_count
if is_thin_lto: if thin_lto_type is not None:
cpu_cap = min(cpu_count, 3) if thin_lto_type == 'goma':
cpu_cap = 1
else:
assert thin_lto_type == 'local'
cpu_cap = min(cpu_count, 6)
explanation.append('cpu_count={} cpu_cap={} mem_total_gb={:.1f}GiB'.format( explanation.append('cpu_count={} cpu_cap={} mem_total_gb={:.1f}GiB'.format(
cpu_count, cpu_cap, mem_total_gb)) cpu_count, cpu_cap, mem_total_gb))
...@@ -109,7 +114,7 @@ def main(): ...@@ -109,7 +114,7 @@ def main():
parser.add_argument('--mem_per_link_gb', type=int, default=8) parser.add_argument('--mem_per_link_gb', type=int, default=8)
parser.add_argument('--reserve_mem_gb', type=int, default=0) parser.add_argument('--reserve_mem_gb', type=int, default=0)
parser.add_argument('--secondary_mem_per_link', type=int, default=0) parser.add_argument('--secondary_mem_per_link', type=int, default=0)
parser.add_argument('--thin-lto', action='store_true') parser.add_argument('--thin-lto')
options = parser.parse_args() options = parser.parse_args()
primary_pool_size, secondary_pool_size, explanation = ( primary_pool_size, secondary_pool_size, explanation = (
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment