diff options
| author | Nathan Chancellor <nathan@kernel.org> | 2026-10-21 11:31:08 -0700 |
|---|---|---|
| committer | Nathan Chancellor <nathan@kernel.org> | 2026-10-21 11:31:08 -0700 |
| commit | 83deedcf85af511dc120b3cd8ee597d211cdf2fb (patch) | |
| tree | d119529d1f9a4cbea27059304773f19b44e4a705 /tools/lib/python | |
| parent | a804c5742bff224d4cb4d25dd383554d598be32b (diff) | |
| parent | e58096244338308dde3fa76982c8042981ddda52 (diff) | |
| download | linux-next-83deedcf85af511dc120b3cd8ee597d211cdf2fb.tar.gz linux-next-83deedcf85af511dc120b3cd8ee597d211cdf2fb.zip | |
Merge branch 'kbuild-fixes-unstable' into kbuild-fixes-for-next
Address following conflicts.
- arch/alpha/boot between
c437950dceb8 ("alpha: add self-extracting compressed kernel boot stub")
and
0d4d70da348b ("kbuild: Mark the gzip recipes as recursive")
- init/Kconfig between
eb13a1ff271b ("random: vDSO: avoid call to memset() when zeroing reserved parameter")
and
f85147b291e3 ("kbuild: move the toolchain checks into scripts/Kconfig.toolchain")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Diffstat (limited to 'tools/lib/python')
| -rwxr-xr-x | tools/lib/python/jobserver.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/lib/python/jobserver.py b/tools/lib/python/jobserver.py index 0b1ffdf9f7a3..7e94635bf7d9 100755 --- a/tools/lib/python/jobserver.py +++ b/tools/lib/python/jobserver.py @@ -29,6 +29,10 @@ $claim child to do the actual work. The end goal here is to keep the total number of build tasks under the limit established by the initial ``make -j$n_proc`` call. +A command that takes its thread count on the command line rather than from +the environment can use the ``%PARALLELISM%`` token in its arguments, which +is replaced by the count, or by 1 when there is no jobserver. + See: https://www.gnu.org/software/make/manual/html_node/POSIX-Jobserver.html#POSIX-Jobserver """ @@ -38,6 +42,8 @@ import os import subprocess import sys +PARALLELISM_TOKEN = "%PARALLELISM%" + def warn(text, *args): print(f'WARNING: {text}', *args, file = sys.stderr) @@ -182,6 +188,9 @@ class JobserverExec: Run a command setting PARALLELISM env variable to the number of available job slots (claim) + 1, e.g. it will reserve claim slots to do the actual build work, plus one to monitor its children. + + Any %PARALLELISM% in the command's arguments is replaced by the same + number, or by 1 when there is no jobserver. """ self.open() # Ensure that self.claim is set @@ -192,4 +201,8 @@ class JobserverExec: if self.claim: os.environ["PARALLELISM"] = str(self.claim) + if not isinstance(cmd, str): + parallelism = str(self.claim or 1) + cmd = [arg.replace(PARALLELISM_TOKEN, parallelism) for arg in cmd] + return subprocess.call(cmd, *args, **pwargs) |
