mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kees Cook <kees@kernel.org>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>,
	Nicolas Schier <nsc@kernel.org>, Lorenzo Stoakes <ljs@kernel.org>,
	Manuel Ebner <manuelebnerli@mailbox.org>,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-hardening@vger.kernel.org
Subject: Re: [PATCH v1 1/2] kbuild: Mark the kernel image gzip recipes as recursive
Date: Fri, 9 Oct 2026 21:46:47 -0700	[thread overview]
Message-ID: <202610092145.5247B47@keescook> (raw)
In-Reply-To: <7109f423-7249-49fb-a923-2824711fe197@paulmck-laptop>

On Fri, Oct 09, 2026 at 09:27:57PM -0700, Paul E. McKenney wrote:
> On Fri, Oct 09, 2026 at 07:25:42PM -0700, Kees Cook wrote:
> > On Fri, Oct 09, 2026 at 08:51:18AM -0700, Paul E. McKenney wrote:
> > > On Thu, Oct 08, 2026 at 11:27:30PM -0700, Kees Cook wrote:
> > > > Since commit 48ebe1cbbeb51 ("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 the gzip recipes as recursive with "+", as commit ecab4115c44cc
> > > > ("kbuild: mark `rustc` (and others) invocations as recursive") did for
> > > > rustc. As with those, "make -n" now runs them.
> > > > 
> > > > Tested ARCH=x86_64 and ARCH=arm64 defconfig with GNU Make 4.3 plus
> > > > CentOS Stream 9's make-4.3-cloexec.patch, GCC 16.2.0, and -j64: without
> > > > this change the warning appears and pigz runs with "-p 1"; with it there
> > > > is no warning, and pigz runs with "-p 54" and "-p 64".
> > > 
> > > Thank you, Kees!
> > > 
> > > My initial test of this patch (using rcutorture) still showed the failure.
> > 
> > Oh! So the patch didn't fix it for you?
> > 
> > > I am running GCC 11.5.0 and without any patches to "make".  I take it
> > > that I need to find and apply CentOS Stream 9's make-4.3-cloexec.patch?
> > > 
> > > But if I use "make -j" instead of rcutorture, this patch does work fine.
> > > Even with "make -j632".
> > 
> > Without rcutorture was "make -jNN" broken for you without this patch?
> > 
> > > I put rcutorture in the background using nohup and full redirection,
> > > but "nohup make -j632 > /tmp/Make.out 2>&1 < /dev/null &" works just
> > > fine.  And running rcutorture in the foreground still fails.
> > > 
> > > Very strange.
> > 
> > O_O It only breaks ... when backgrounded? Oh my. Okay, I will try to
> > figure that out.
> 
> Apologies, let me present my results in a more organized fashion:
> 
> 			foreground	background
> 			-next	Fix	-next	Fix
> 
> 	make -jN	Bug	Good	Bug	Good
> 
> 	kvm.sh [1]	Bug	Bug	Bug	Bug
> 
> [1] tools/testing/selftests/rcutorture/bin/kvm.sh --build-only --allcpus --configs TREE02 --trust-make
> 
> Here, -next is next-20261008, and Fix is with your patch on it.
> 
> Just as mystifying to me, to be honest!

Ah, I think I found it, but I'm not sure why kvm.sh tripped it but bare
"make" didn't. I missed the non-literal forms:

	$(call if_changed,$(compress-y))

I'll send a v2 with docs updated too.

-- 
Kees Cook

  reply	other threads:[~2026-10-10  4:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-09  6:27 [PATCH v1 0/2] kbuild: Give jobserver-exec recipes the jobserver Kees Cook
2026-10-09  6:27 ` [PATCH v1 1/2] kbuild: Mark the kernel image gzip recipes as recursive Kees Cook
2026-10-09  9:08   ` Nicolas Schier
2026-10-09 12:05   ` Lorenzo Stoakes (ARM)
2026-10-09 15:52     ` Paul E. McKenney
2026-10-09 15:51   ` Paul E. McKenney
2026-10-10  2:25     ` Kees Cook
2026-10-10  4:27       ` Paul E. McKenney
2026-10-10  4:46         ` Kees Cook [this message]
2026-10-10  5:07           ` Paul E. McKenney
2026-10-10  8:28         ` Kees Cook
2026-10-10 21:08           ` Paul E. McKenney
2026-10-09  6:27 ` [PATCH v1 2/2] kbuild: Mark the initcall ordering recipe " Kees Cook
2026-10-09 15:20   ` Nicolas Schier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202610092145.5247B47@keescook \
    --to=kees@kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ljs@kernel.org \
    --cc=manuelebnerli@mailbox.org \
    --cc=nathan@kernel.org \
    --cc=nsc@kernel.org \
    --cc=paulmck@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®