]> git.ipfire.org Git - thirdparty/linux.git/commit
tools/docs: sphinx-build-wrapper: allow building PDF files in parallel
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 18 Sep 2025 11:54:50 +0000 (13:54 +0200)
committerJonathan Corbet <corbet@lwn.net>
Thu, 18 Sep 2025 17:18:39 +0000 (11:18 -0600)
commit08e14bc17eca275352f00defb17506799b99626c
treefe73215be92beadce9af7edc6c57f6290c96c0a9
parent2f99b85e22b918b9659d072d6cc8baf51b4922f3
tools/docs: sphinx-build-wrapper: allow building PDF files in parallel

Use POSIX jobserver when available or -j<number> to run PDF
builds in parallel, restoring pdf build performance. Yet,
running it when debugging troubles is a bad idea, so, when
calling directly via command line, except if "-j" is splicitly
requested, it will serialize the build.

With such change, a PDF doc builds now takes around 5 minutes
on a Ryzen 9 machine with 32 cpu threads:

# Explicitly paralelize both Sphinx and LaTeX pdf builds
$ make cleandocs; time scripts/sphinx-build-wrapper pdfdocs -j 33

real 5m17.901s
user 15m1.499s
sys 2m31.482s

# Use POSIX jobserver to paralelize both sphinx-build and LaTeX
$ make cleandocs; time make pdfdocs

real 5m22.369s
user 15m9.076s
sys 2m31.419s

# Serializes PDF build, while keeping Sphinx parallelized.
# it is equivalent of passing -jauto via command line
$ make cleandocs; time scripts/sphinx-build-wrapper pdfdocs

real 11m20.901s
user 13m2.910s
sys 1m44.553s

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Message-ID: <42eef319f9af6f9feb12bcd74ca6392c8119929d.1758196090.git.mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
tools/docs/sphinx-build-wrapper