linux/arch
Kees Cook 0d4d70da34
kbuild: Mark the gzip recipes as recursive
Since commit 48ebe1cbbe ("kbuild: compress the kernel with pigz if
available"), cmd_gzip runs pigz through scripts/jobserver-exec, which
takes the job slots make has free. GNU Make passes the jobserver pipe
only to recipes it treats as recursive, but leaves --jobserver-auth in
MAKEFLAGS for all of them. The make 4.3 in CentOS Stream 9 also hides
the pipe in sub-makes (a backport of the fix for GNU Make bug 58232), so
jobserver-exec cannot open it, runs pigz on one thread, and prints:

  WARNING: Unable to reopen jobserver read-side pipe: FileNotFoundError(2, 'No such file or directory')

Mark every recipe that can run cmd_gzip as recursive with "+", as
commit ecab4115c4 ("kbuild: mark `rustc` (and others) invocations as
recursive") did for rustc. Besides the $(call if_changed,gzip) rules,
this covers those that choose gzip through a variable: the built-in
initramfs in usr/Makefile (which rcutorture's kvm.sh builds), the EFI
zboot image, and the arm, csky, and mips compressed images. As with
rustc, "make -n" now runs these recipes, including those that choose
through a variable when they select another compressor. Also update the
gzip entry in Documentation/kbuild/makefiles.rst, as suggested in
review.

Tested with GNU Make 4.3 plus CentOS Stream 9's make-4.3-cloexec.patch,
GCC 16.2.0, and -j64, on ARCH=x86_64, arm64, and arm defconfig, and
ARCH=x86_64 defconfig with a built-in initramfs: none of them prints the
warning, and pigz gets the free job slots (-p 54, 64, and 50 for the
kernel image). Without this change, the x86_64 builds print it for the
kernel image and for the initramfs.

Reported-by: Paul E. McKenney <paulmck@kernel.org>
Closes: https://lore.kernel.org/all/0ddb5e5e-f801-444c-aa98-0cfe814a3026@paulmck-laptop/
Fixes: 48ebe1cbbe ("kbuild: compress the kernel with pigz if available")
Assisted-by: LLM
Reviewed-by: Nicolas Schier <n.schier@fritz.com>
Acked-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Signed-off-by: Kees Cook <kees@kernel.org>
Tested-by: Paul E. McKenney <paulmck@kernel.org>
Link: https://patch.msgid.link/20261010081914.540611-1-kees@kernel.org
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
2026-10-11 01:20:04 +01:00
..
alpha kbuild: Mark the gzip recipes as recursive 2026-10-11 01:20:04 +01:00
arc kbuild: Mark the gzip recipes as recursive 2026-10-11 01:20:04 +01:00
arm kbuild: Mark the gzip recipes as recursive 2026-10-11 01:20:04 +01:00
arm64 kbuild: Mark the gzip recipes as recursive 2026-10-11 01:20:04 +01:00
csky kbuild: Mark the gzip recipes as recursive 2026-10-11 01:20:04 +01:00
hexagon Treewide timer related cleanups: 2026-08-18 15:58:29 -07:00
loongarch kmalloc_obj conversions for v7.3-rc2 2026-09-05 20:45:18 -07:00
m68k m68knommu: updates and fixes for v7.3 2026-08-28 08:44:36 -07:00
microblaze kbuild: Mark the gzip recipes as recursive 2026-10-11 01:20:04 +01:00
mips kbuild: Mark the gzip recipes as recursive 2026-10-11 01:20:04 +01:00
nios2 kbuild: Mark the gzip recipes as recursive 2026-10-11 01:20:04 +01:00
openrisc OpenRISC 7.3 updates 2026-08-30 09:26:54 -07:00
parisc kbuild: Mark the gzip recipes as recursive 2026-10-11 01:20:04 +01:00
powerpc treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
riscv kbuild: Mark the gzip recipes as recursive 2026-10-11 01:20:04 +01:00
s390 kbuild: Mark the gzip recipes as recursive 2026-10-11 01:20:04 +01:00
sh kbuild: Mark the gzip recipes as recursive 2026-10-11 01:20:04 +01:00
sparc kbuild: Mark the gzip recipes as recursive 2026-10-11 01:20:04 +01:00
um um: Use asm-generic/timex.h over the host architecture one 2026-08-24 17:10:35 -07:00
x86 kbuild: Mark the gzip recipes as recursive 2026-10-11 01:20:04 +01:00
xtensa kbuild: Mark the gzip recipes as recursive 2026-10-11 01:20:04 +01:00
.gitignore
Kconfig VDSO updates: 2026-08-18 16:56:25 -07:00