Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Rong Xu <xur@google.com>
Cc: Masahiro Yamada <masahiroy@kernel.org>,
	Nicolas Schier <nicolas.schier@linux.dev>,
	Nick Desaulniers <nick.desaulniers+lkml@gmail.com>,
	Bill Wendling <morbo@google.com>,
	Justin Stitt <justinstitt@google.com>,
	Miguel Ojeda <ojeda@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Alice Ryhl <aliceryhl@google.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	"Mike Rapoport (Microsoft)" <rppt@kernel.org>,
	Rafael Aquini <aquini@redhat.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Stafford Horne <shorne@gmail.com>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Teresa Johnson <tejohnson@google.com>,
	linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org,
	llvm@lists.linux.dev
Subject: Re: [PATCH] kbuild: distributed build support for Clang ThinLTO
Date: Wed, 30 Apr 2025 18:20:19 -0700	[thread overview]
Message-ID: <20250501012019.GB3762678@ax162> (raw)
In-Reply-To: <CAF1bQ=RWmNt1xnnoQrsBG6-TXzSiqX6e-_Squ22UOSmUi-Tr8w@mail.gmail.com>

Hi Rong,

On Tue, Apr 29, 2025 at 01:34:00PM -0700, Rong Xu wrote:
> Just wanted to gently follow up on this patch that I sent previously.
> 
> From a toolchain and compiler perspective, I genuinely believe that
> kernel ThinLTO builds should use this. I really want to get some feedback
> and reviews on this patch.

My apologies for some radio silence, other regressions and issues have
been higher priority until now. I will try to take a closer look at this
soon but I do have one comment based on your comment above and the
Kconfig help text...

> On Sat, Apr 19, 2025 at 6:02 PM <xur@google.com> wrote:
...
> > diff --git a/arch/Kconfig b/arch/Kconfig
> > index b0adb665041f1..cbeeeb9b076d8 100644
> > --- a/arch/Kconfig
> > +++ b/arch/Kconfig
> > @@ -810,6 +810,18 @@ config LTO_CLANG_THIN
> >             https://clang.llvm.org/docs/ThinLTO.html
> >
> >           If unsure, say Y.
> > +
> > +config LTO_CLANG_THIN_DIST
> > +       bool "Clang ThinLTO in distributed mode (EXPERIMENTAL)"
> > +       depends on HAS_LTO_CLANG && ARCH_SUPPORTS_LTO_CLANG_THIN
> > +       select LTO_CLANG
> > +       help
> > +         This option enables Clang's ThinLTO in distributed build mode.
> > +         In this mode, the linker performs the thin-link, generating
> > +         ThinLTO index files. Subsequently, the build system explicitly
> > +         invokes ThinLTO backend compilation using these index files
> > +         and pre-linked IR objects. The resulting final object files
> > +         are with the .final_o suffix.
> >  endchoice

This says what the option does but it does not really say why the user
would want to use this over CONFIG_LTO_CLANG_THIN_DIST; even as someone
relatively familiar with these technologies, I am not sure what this
means for the build or resulting kernel. Is there any reason why a user
would want to use in-process ThinLTO instead of distributed? You seem to
make the case above and in Discourse that the kernel would benefit from
this, so should we just wholesale replace in-process ThinLTO with the
distributed one?

Cheers,
Nathan

  reply	other threads:[~2025-05-01  1:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-20  1:02 [PATCH] kbuild: distributed build support for Clang ThinLTO xur
2025-04-29 20:34 ` Rong Xu
2025-05-01  1:20   ` Nathan Chancellor [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-04-20  5:17 kernel test robot

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=20250501012019.GB3762678@ax162 \
    --to=nathan@kernel.org \
    --cc=aliceryhl@google.com \
    --cc=aquini@redhat.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=justinstitt@google.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=masahiroy@kernel.org \
    --cc=morbo@google.com \
    --cc=mpe@ellerman.id.au \
    --cc=nick.desaulniers+lkml@gmail.com \
    --cc=nicolas.schier@linux.dev \
    --cc=ojeda@kernel.org \
    --cc=rppt@kernel.org \
    --cc=samitolvanen@google.com \
    --cc=shorne@gmail.com \
    --cc=tejohnson@google.com \
    --cc=tglx@linutronix.de \
    --cc=xur@google.com \
    /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